Skip to content
Advertisement

Jquery and Slimframework – Status Request

How can I response a Jquery $.post call with Slimframework 3 with multiples status code?

my code is:

Javascript:

JavaScript

PHP:

JavaScript

With this code, I always receive a status code 200 from post action. And I was expecting a 201 or 503 status code.

Advertisement

Answer

The request and response headers are “immutable”.

Instead of this:

JavaScript

Try this:

JavaScript

or

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement