http icon indicating copy to clipboard operation
http copied to clipboard

`MediaType` is not exported to parent project

Open bambinoua opened this issue 2 years ago • 3 comments

When I use MultipartFile constructors I could not specify the contentType property because MediaType from http_parser package is used internally in multipart_file.dart file and not exported into the target project.

bambinoua avatar Feb 15 '23 11:02 bambinoua

I just ran into this. Also see #342 and #296.

You can fix this by including the http_parser library (although I'm also curious if it's worth re-exporting MediaType as part of the http package).

import 'package:http_parser/http_parser.dart';
// or
import 'package:http_parser/http_parser.dart' show MediaType;

jamiesyme avatar Feb 29 '24 00:02 jamiesyme

Yes. I did so but it is strange to import a whole additional package just for import the data type which is used by class from http, isn't it?

bambinoua avatar Feb 29 '24 14:02 bambinoua