Answer the question
In order to leave comments, you need to log in
How to get response.body of request on 400 error and CORS?
There is an application, REST API, symfony 2.8, NGINX.
In some cases, it is required to return a 400 error with a request body that contains errors. In the symphonic apishka interface, everything comes fine, but in my application there is no response.body ...
Is there a way to get the body of an error? Thank you.
$.ajax({
type: 'POST',
url: someurl,
data: data,
}).done(response => {
console.log(response);
}).catch(error => {
console.log(error);
})
Answer the question
In order to leave comments, you need to log in
Work with ajax natively, jquery will throw an error on all statuses except 2xx
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question