Content-Type application/x-www-form-urlencoded
See original GitHub issueTry to send request with content type application/x-www-form-urlencoded
var data = Querystring.stringify({
"grant_type": "password",
"username": login,
"password": password
});
axios.post(Urls.login, data);
but there is no such header in request.
I tried to use code:
var data = Querystring.stringify({
"grant_type": "password",
"username": login,
"password": password
});
return axios({
method: 'post',
url: Urls.login,
data: data,
headers: {
'Content-type': 'application/x-www-form-urlencoded'
}
});
same problem
jquery code works fine:
$.ajax({
url: Urls.login,
data: data,
type: "POST",
headers: {
'Content-type': 'application/x-www-form-urlencoded'
}
});
How can I use axios to send request with this header?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:101
- Comments:220 (5 by maintainers)
Top Results From Across the Web
application/x-www-form-urlencoded or multipart/form-data?
The content type "application/x-www-form-urlencoded" is inefficient for sending large quantities of binary data or text containing non-ASCII characters.
Read more >POST - HTTP - MDN Web Docs
The HTTP POST method sends data to the server. The type of the body of the request is indicated by the Content-Type header....
Read more >'x-www-form-urlencoded' or 'form-data' ? Explained in 2 mins.
Send a request with form-data. Content Type. content-type. x-www-form-urlencoded, application/x- ...
Read more >Content Type : x-www-form-urlencoded, form-data and json
Basically there are three ways to send the HTML data to the server. “Content Type : x-www-form-urlencoded, form-data and json” is published ...
Read more >Difference Between form-data, x-www-form-urlencoded and ...
The URL-encoded data sends encoded data to the server, and uses the same encoding as that of the URL parameters. To use it,...
Read more >Top Related Medium Post
Top Related StackOverflow Question
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
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
You can use a library like qs instead:
+1 for issue.