Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What will be the http status code for data save failed

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?

like image 737
Tahmidur Rahman Avatar asked Apr 24 '18 05:04

Tahmidur Rahman


People also ask

What is a 309 status code?

Status codes 309 through 399 are currently unassigned.

What is the status code for failed?

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.

What is 204 status code HTTP?

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.

What is HTTP status code1?

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.


1 Answers

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

like image 140
Julian Reschke Avatar answered Oct 26 '22 06:10

Julian Reschke