0

我正在为另一家公司创建网页。如果此网站创建错误或有任何错误,我不能将其出售给公司。我知道有几种类型的 http 状态代码。例如,我知道地址错误时会出现 404 错误,但我不知道任何其他 http 状态代码。谁能告诉我它们是什么?

编辑:

我也想知道我可以设计什么风格。因此,例如,可以通过在 .htaccess 文件中说出我的文档的位置,以我自己的方式设置 404 状态代码的样式

4

4 回答 4

2

您可以在此处找到 HTTP 状态代码的完整列表: http ://en.wikipedia.org/wiki/List_of_HTTP_status_codes

于 2013-10-05T18:53:35.560 回答
2

您在寻找 http 状态码吗?如果是,请检查此 wiki 链接http://en.wikipedia.org/wiki/List_of_HTTP_status_codes

于 2013-10-05T18:56:04.370 回答
2

所有可能的代码。主要用于处理错误场景,我们关心400500系列。

解决方案:检查 http 响应代码是否属于 400 或 500 系列,如果是,则将页面重定向到某个错误页面,定义错误消息出现了什么问题或定义一些自定义消息以显示给客户端(对最终用户更有意义)。这样,应用程序将优雅地处理错误场景。

->  100:
return "Continue";
->  101:
return "Switching Protocols";
->  102:
return "Processing (WebDAV)";
->  200:
return "OK";
->  201:
return "Created";
->  202:
return "Accepted";
->  203:
return "Non-Authoritative Information";
->  204:
return "No Content";
->  205:
return "Reset Content";
->  206:
return "Partial Content";
->  207:
return "Multi-Status (WebDAV)";
->  300:
return "Multiple Choices";
->  301:
return "Moved Permanently";
->  302:
return "Found";
->  303:
return "See Other";
->  304:
return "Not Modified";
->  305:
return "Use Proxy";
->  307:
return "Temporary Redirect";
->  400:
return "Bad Request";
->  401:
return "Unauthorized";
->  402:
return "Payment Required";
->  403:
return "Forbidden";
->  404:
return "Not Found";
->  405:
return "Method Not Allowed";
->  406:
return "Not Acceptable";
->  407:
return "Proxy Authentication Required";
->  408:
return "Request Time-out";
->  409:
return "Conflict";
->  410:
return "Gone";
->  411:
return "Length Required";
->  412:
return "Precondition Failed";
->  413:
return "Request Entity Too Large";
->  414:
return "Request-URI Too Large";
->  415:
return "Unsupported Media Type";
->  416:
return "Requested range not satisfiable";
->  417:
return "Expectation Failed";
->  422:
return "Unprocessable Entity (WebDAV)";
->  423:
return "Locked (WebDAV)";
->  424:
return "Failed Dependency (WebDAV)";
->  500:
return "Internal Server Error";
->  501:
return "Not Implemented";
->  502:
return "Bad Gateway";
->  503:
return "Service Unavailable";
->  504:
return "Gateway Time-out";
->  505:
return "HTTP Version not supported";
->  507:
return "Insufficient Storage (WebDAV)";
->  510:
return "Not Extended";
于 2013-10-05T19:03:54.960 回答
0

有几个地方可以看:

HTTP 状态码错误

HTTP 状态码列表 - 维基百科

HTTP 错误和状态码解释

100-199:信息状态

200-299:成功状态

300-399 : 重定向状态

400-499:客户端错误

500-599:服务器错误

实际上,重要的只是 400-500 个代码。其他也很重要,但没有那么重要。

于 2013-10-05T19:02:17.807 回答