-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Defaults headers Content-Type don't allow "content-type" ? #3104
Comments
I think For expected work, it has to call But If you will directly change header like this axios.defaults.headers.common['Content-Type'] = 'application/json'; There is nowhere to call this function. But I agree your opinion need a note of this on the "Global axios defaults" section. |
I had this same issue couple of days ago. I had resolved this issue by using this header. { 'content-type': 'application/x-www-form-urlencoded' } |
@karandeepvirk85 |
See #2880.
Note that it explains headers in response, which is different with axios config. And I'd like share more-stories-about-headers. |
After looking at your document, I think my explanation is wrong. Now The headers setting is not case sensitive. Is it right? |
Describe the issue
This request header Content-Type become
application/json, application/json;charset=utf-8
.GET / POST methods option can use
'content-type'
too.But
defaults.headers
is only allow the'Content-Type'
?Example Code
Global axios defaults
Request methods config
Content-Type
application/json, application/json;charset=utf-8
requests ite become emptyreq.body
in Express.Expected behavior, if applicable
Request methods config can use
Content-Type
andcontent-type
too. (This document was written the"content-type"
in Response Schema )But
defaults.headers
can use onlyContent-Type
.It's made me little confused. I sorry, I don't know if it's a specification or not.
if it's a specification, need a note of this on the "Global axios defaults" section, I think. Thank you.
Environment
Additional context/Screenshots
The text was updated successfully, but these errors were encountered: