-1

I have to send a get request to get a value from server and display it in my react application. But for some reason it is throwing 400 error code. I think there might be an issue with my get request. So I read many articles but they all said that you can send it using params property of config object of axios.get but I have to send it as body of request.

This is how I'm trying to do it enter image description here

1 Answers1

0

GET requests shouldn't have any request body. Your request is giving 400 because the server can't compile your GET request with a request body. If you want to retrieve data from the backend, you can send params in the URL or request header.

For more info, you can visit this same question asked https://stackoverflow.com/questions/978061/http-get-with-request-body[][1]