Closed escamoteur closed 1 week ago
ok, I now found out the malform was the result that I did not use the correct value for Content-Length. after adding this to my code:
multipartRequest.headers.addAll({
'Content-Length': multipartRequest.contentLength.toString(),
});
it works. Still, this should probably be done automatically
just tested with S3 works perfectly
While exited about the new cupertino_http package we found out, that we currently can't use it because it does not att a
Content-Length
header in Multipart file uploadsand if I add this header manually I get an 400 from S3 with the message that the request isn't a well-formed multipart request.See how they compare:
I also attach the two requests as raw text files ( I only replace our URLs with XXX) I also wonder why the Cupertino Client includes data from sentry in a Request that has nothing to do with sentry. this could be a privacy violation.
this is how we do the Upload:
As we have customers who complain about uploading errors (Connection closed before...) on iOS we would really like to use the new client. If we can change something in the way we use it any pointer would be really helpful. As it works with the normal Dart HttpClient and in cronnet it seems to be a problem with cupertino_htttp. cuppertino_client.txt HttpClient.txt
cc @brianquinlan