for the API call to work. Without it I always receive a 415 error saying that application/octet-stream is not supported as content type for the JSON parameter. I tried setting the content type to application/json in the Part annotation of the parameter to no avail. I also tried manually sending a MultipartFile object to the request but that didn't work as well.
I would like a provision in the package which allows us to send a String as a MultipartFile in the files fields of the FormData being generated by the generator.
Any alternative solution to fix this problem is also fine.
Thanks.
To send a JSON object as a
String
along with someFile
s, I need to explicitly change the generated.g.dart
file fromto
for the API call to work. Without it I always receive a 415 error saying that
application/octet-stream
is not supported as content type for the JSON parameter. I tried setting the content type toapplication/json
in thePart
annotation of the parameter to no avail. I also tried manually sending aMultipartFile
object to the request but that didn't work as well.I would like a provision in the package which allows us to send a
String
as a MultipartFile in thefiles
fields of theFormData
being generated by the generator.Any alternative solution to fix this problem is also fine. Thanks.