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
For REST APIs, it's quite common to have POST (and possibly PUT) methods that do not require a body. In method request_async2, any nil body gets transformed into an empty string. When create_request is called through do_request_async, it sets the content type to application/x-www-form-urlencoded if the body is "true" and no content type is provided. However, that should not be necessary if the body is empty.
As a workaround we now had to explicitly specify a content type (text/plain), but it would be better to simply not set a default content type if the body is empty.
Note that this is an issue that only occurs when using the async methods; the non-async methods do not transform nil bodies into empty strings.
The text was updated successfully, but these errors were encountered:
For REST APIs, it's quite common to have POST (and possibly PUT) methods that do not require a body. In method
request_async2
, anynil
body gets transformed into an empty string. Whencreate_request
is called throughdo_request_async
, it sets the content type toapplication/x-www-form-urlencoded
if the body is "true" and no content type is provided. However, that should not be necessary if the body is empty.As a workaround we now had to explicitly specify a content type (
text/plain
), but it would be better to simply not set a default content type if the body is empty.Note that this is an issue that only occurs when using the async methods; the non-async methods do not transform
nil
bodies into empty strings.The text was updated successfully, but these errors were encountered: