You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use http.put() and supply a JSON encoded string as the body or a utf8 encoded series of bytes representing the same string as the bodyBytes, the body will not be sent with the request regardless of me specifying the content type as either
final headers =<String, String>{
'Content-Type':'application/json',
};
or
final headers =<String, String>{
'Content-Type':'application/json; charset=UTF-8',
};
The content type will be there, but the body is just not sent. The exact same body and headers will send the body when using http.post.
My question is: Is this intended behavior?
The server I am communicating with is under my control so I can change the method(will not do that as I am obviously PUTting data in this use case), and I can also switch it to use x-www-url-encoded (my temporary workaround), but there is no standards-based reason for JSON not to be sent with a PUT.
If additional context is needed, I am happy to help out some old friends, and please tell me if there is something I'm missing or getting wrong. :-)
The text was updated successfully, but these errors were encountered:
When I use
http.put()
and supply a JSON encoded string as thebody
or a utf8 encoded series of bytes representing the same string as thebodyBytes
, the body will not be sent with the request regardless of me specifying the content type as eitheror
The content type will be there, but the body is just not sent. The exact same body and headers will send the body when using
http.post
.My question is: Is this intended behavior?
The server I am communicating with is under my control so I can change the method(will not do that as I am obviously PUTting data in this use case), and I can also switch it to use x-www-url-encoded (my temporary workaround), but there is no standards-based reason for JSON not to be sent with a PUT.
If additional context is needed, I am happy to help out some old friends, and please tell me if there is something I'm missing or getting wrong. :-)
The text was updated successfully, but these errors were encountered: