per the docs for UnityWebRequest.Post(), the post body “Will be URLEncoded via WWWTranscoder.URLEncode prior to transmission”.
< rant >
this is crazy. nowhere does the HTTP spec require that POST data be URL-Encoded.
a good HTTP client should assume the user (me) knows what they’re doing and can URL-Encode their own data if required. look at Curl. does Curl automatically url-encode the body if the method is POST ? no. if you’re writing an HTTP client and you find yourself diverging from what Curl does, check yourself.
< /rant >
is there a way to disable this ?
- setting the content type “text/plain”
- setting the UploadHandler’s content type to “text/plain”
a workaround that does seem to work but is a total hack is to use UnityWebRequest.Put() instead, and change the method to POST before Sending it.
also, this is a change from the previous WWW HTTP Client framework, and the statement in the manual that “For end-users who only employ common WWW use cases, transitioning to the new system should be almost a find-and-replace process.” is way off-base because of this.