Error: Request failed with status code 500
See original GitHub issueHi, When I try
axios.get(this.$server+'/transco/gettable/COREPDMINTERVALTYPO_INPUT')
.then(function (response) {
// handle success
console.log(response);
})
.catch(function (error) {
// handle error
console.log(error);
})
.then(function () {
// always executed
});
I get error 500 :
GET http://localhost:8081/transco/gettable/TABLE_TEST 500 (Internal Server Error)
But if I do it directly (http://localhost:8081/transco/gettable/TABLE_TEST) in my browser it works.
I don’t know why can you help me ? thx
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
500 Internal Server Error - HTTP - MDN Web Docs - Mozilla
This error response is a generic "catch-all" response. Usually, this indicates the server cannot find a better 5xx error code to response.
Read more >Axios POST request fails with error status code 500
Solution: In the catch block, the error which will always be 500 internal server error; so, use error.response.data instead of error . Code:...
Read more >What Is a "500 Internal Server Error" and How Do I Fix It?
They indicate that the server failed to complete the request because server encountered an error. When you try to visit a website and...
Read more >How to Fix a 500 Internal Server Error on Your WordPress Site
The 500 (Internal Server Error) status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the ...
Read more >HTTP 500 Internal Server Error: What It Means & How to Fix It
A 500 internal server error is, as the name implies, a general problem with the website's server. More than likely, this means there's...
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
Once again, if you’re getting a 5xx error code, it’s due to your backend code. If it’s different from typing the URL by hand in the browser, check your backend code regarding request headers, cookies, etc. This has nothing to do with Axios.
The below worked with me: const deptsURL = “http://localhost:8099/ords/hr/hrm/depts”; var vAttributes = {}; vAttributes = { departmentid: model.attributes[model.idAttribute] , departmentname: $(“#newDepartName”).val() , managerid: 100 , locationid: 1700 }; const ops = { method: ‘POST’, headers: { ‘content-type’: ‘application/json’ }, data: JSON.stringify(vAttributes) , url: deptsURL }; axios( ops).then((res) => { console.log("post response: " + res); }).catch(function (error) { console.log("post error: " + error); });