Content-Type header is getting overridden
See original GitHub issueI need to pass Content-Type : application/x-www-form-urlencoded; charset=UTF-8
as the header. But when I try the following way
AndroidNetworking
.post(Url.BASE_URL + requestPath)
.addHeaders("Content-Type", "application/x-www-form-urlencoded; charset=utf-8")
.setContentType("application/x-www-form-urlencoded; charset=utf-8")
.addBodyParameter(requestPath.split("/").last(), jsonString)
.setPriority(Priority.MEDIUM)
.build()
.getAsJSONObject(jsonObjectRequestListener)
its setting the header as Content-Type: application/x-www-form-urlencoded
and charset=UTF-8 is getting removed. How to forcefully add this complete thing as header ?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
content-type header being overwritten during POST request
It is only when I do the POST request from my web service that the content-type is being overriden at the time of...
Read more >Content-Type getting overwritten? · Issue #532 · libcpr/cpr
I'm experiencing a strange problem where for some requests, not all, if I set the content-type header explicitly it seems to be ignored...
Read more >How can I override the http content-type header that the ...
Information · Open the WS CM job definition · Navigate to the Variables table (or click on the Autoedit tab if version 7...
Read more >Impossible to override Content-Type header? - Google Groups
In my case I generate a HEAD handler automatically if there is a GET handler. I think for HEAD requests, there should be...
Read more >FAQ: Can you override Content-Type header as part of Rest ...
This is currently not possible. This is a known issue where trying to override the Content-Type header in the Rest Consumer transformation ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this is the only way to send content type when iam trying to send application/x-www-form-urlencoded in addheader method not working i want to send it in add header how to do that. i dont want to use method setContentType i want to make this in AddHeader method only.
@amitshekhariitbhu … Sorry by mistake it was closed. Any update on this ?