Sent 3 data with post request. For some reason it couldn't be saved on database table. Such as, foreign key constraint failed. then what will be the http status code?
Status codes 309 through 399 are currently unassigned.
The 424 (Failed Dependency) status code means that the method could not be performed on the resource because the requested action depended on another action and that action failed.
The HTTP 204 No Content success status response code indicates that a request has succeeded, but that the client doesn't need to navigate away from its current page.
We tend to get -1 status codes when there are network issues or connection problems, so we display the user a network problems page in those cases.
500-599
is reserved for server errors in HTTP response status codes.
500
specifically is for Internal Server Error, which you could throw in the event that a validation error occured.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses
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