I have a table with lots of generic link from a DB.
Now the customer wants to restrict certain types to be linked (or showed). Changing the page that makes the links is very hard, so I want to show some alert to user but would be ideal that the browser stays in the page, instead of navigation to an empty one and force the user o press back.
Is there a HTTP status code that tells the browser to stay in the current page?
The POST method is used to send data to the server. Perhaps the most common status code returned is 200. It simply means that the request was received, understood, and is being processed, whereas the 201 status code indicates that a request was successful and a resource was created as a result. 1.
The HTTP 200 OK success status response code indicates that the request has succeeded. A 200 response is cacheable by default. The meaning of a success depends on the HTTP request method: GET : The resource has been fetched and is transmitted in the message body.
Servers return a 500 HTTP status when the browser makes a valid request, but an internal error in the server prevents it from returning the page.
The HTTP 201 Created success status response code indicates that the request has succeeded and has led to the creation of a resource.
You could try with 204 No Content
See the HTTP RFC
If the client is a user agent, it SHOULD NOT change its document view from that which caused the request to be sent. This response is primarily intended to allow input for actions to take place without causing a change to the user agent's active document view, although any new or updated metainformation SHOULD be applied to the document currently in the user agent's active view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With