S
S
SirAlejandro2018-03-13 18:26:23
JavaScript
SirAlejandro, 2018-03-13 18:26:23

How to get error text via AJAX in PHP?

I am learning how to do SPA. I use Laravel for this in conjunction with Vue. Data exchange with the server occurs exclusively through AJAX (Axios). And now, trying to send an email to reset the password, I ran into a problem:
In the response from the server, only the error code is returned (note I have 500 Internal server Error) But I would like the text itself to be returned. To understand what exactly went wrong...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill Babak, 2018-03-13
@SirAlejandro

Before submitting
DevTools -> Network ( Chrome )
will be highlighted in red

M
mShpakov, 2018-03-13
@mShpakov

If laravel is API-only, then look at lumen
Make a "response" which will return the response from the server. It will actually generate a json response with server codes and so on.
And on the spa side, make a "plugin" that will send data and process responses

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question