Getting 400 Bad Request Error
See original GitHub issueIssue
Hi, I’m getting 400 when I try to hit my api. The api is working fine. I have validate the API’s via postman and already consuming in the nodejs application but in react-native this is not working.
Here is my code
axios({
method: 'post',
url: 'https://api-helper.azurewebsites.net/token',
data: {
username: 'api',
password: 'MY_PASSWORD',
grant_type: 'MY_GRANT_TYPE'
},
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
}
}).then((response) => {
console.log('token', response);
})
.catch((response) => console.log('error', response));
Issue Analytics
- State:
- Created 5 years ago
- Reactions:20
- Comments:7
Top Results From Across the Web
How to Fix a 400 Bad Request Error (Causes and Fixes) - Kinsta
How to Fix 400 Bad Request Error? · 1. Check the Submitted URL · 2. Clear Browser Cache · 3. Clear Browser Cookies...
Read more >What is a 400 Bad Request Error (and How Can I Fix It)?
A 400 Bad Request Error occurs when a request sent to the website server is incorrect or corrupt, and the server receiving the...
Read more >What is HTTP error 400 and how do you fix it? - IT PRO
A 400 Bad Request error is usually a client-side error. A good case in point is a URL string syntax error. Incorrectly typed...
Read more >How to Fix the 400 Bad Request Error - Lifewire
The 400 Bad Request error means that the request you sent to the website server to view the page was somehow incorrect.
Read more >400 Bad Request - HTTP - MDN Web Docs
The HyperText Transfer Protocol (HTTP) 400 Bad Request response status code indicates that the server cannot or will not process the request ......
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
Have you tried using this format?
.catch((error) => console.log( error.response.request._response ) );
`