Php RESTAPI标准状态代码
我为ios应用程序创建了一个RESTAPI,它有一个超薄的框架。 为了识别Post请求,我创建了自己的状态代码集。 如下所示的错误响应Php RESTAPI标准状态代码,php,api,Php,Api,我为ios应用程序创建了一个RESTAPI,它有一个超薄的框架。 为了识别Post请求,我创建了自己的状态代码集。 如下所示的错误响应 {"status":"Incorrect Pin","code":3} {"status":"server error","code":4} 但我们的应用程序开发者表示,这与国际标准不符。 他提出了如下建议 {"status":"Incorrect Pin","code":404} {"status":"servererror","code":404}
{"status":"Incorrect Pin","code":3}
{"status":"server error","code":4}
但我们的应用程序开发者表示,这与国际标准不符。
他提出了如下建议
{"status":"Incorrect Pin","code":404}
{"status":"servererror","code":404}
我知道200404是基本的http状态码,但这种代码的国际标准是什么?
有人能给我解释一下吗?我想你在寻找下面的状态码
100 => 'Continue',
101 => 'Switching Protocols',
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
203 => 'Non-Authoritative Information',
204 => 'No Content',
205 => 'Reset Content',
206 => 'Partial Content',
300 => 'Multiple Choices',
301 => 'Moved Permanently',
302 => 'Found',
303 => 'See Other',
304 => 'Not Modified',
305 => 'Use Proxy',
306 => '(Unused)',
307 => 'Temporary Redirect',
400 => 'Bad Request',
401 => 'Unauthorized',
402 => 'Payment Required',
403 => 'Forbidden',
404 => 'Not Found',
405 => 'Method Not Allowed',
406 => 'Not Acceptable',
407 => 'Proxy Authentication Required',
408 => 'Request Timeout',
409 => 'Conflict',
410 => 'Gone',
411 => 'Length Required',
412 => 'Precondition Failed',
413 => 'Request Entity Too Large',
414 => 'Request-URI Too Long',
415 => 'Unsupported Media Type',
416 => 'Requested Range Not Satisfiable',
417 => 'Expectation Failed',
426 => 'Upgrade required'
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway',
503 => 'Service Unavailable',
504 => 'Gateway Timeout',
505 => 'HTTP Version Not Supported');
我从
编辑:添加状态代码426=>需要升级
谢谢@Nisse Engström
Also you can look all the here https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
您的列表缺少状态代码。