HTTP是一种基于TCP/IP万维网(World Wide Web) 上数据传输的绝对基础。多年来,HTTP 一直是一个强大的协议,其中大量的数据通过HTTP在客户端和服务器之间发送。 本质上,HTTP(Essentially HTTP)基于客户端-服务器架构,其中 Web 浏览器和搜索引擎充当HTTP客户端,而Web服务器充当服务器。客户端和服务器的请求/响应通过TCP/IP连接进行通信。浏览器客户端以URL(URL)的形式向 Web 服务器发起请求并且 Web 服务器响应请求的资源以及浏览器HTTP标头中存在的HTTPS 状态代码(HTTPS status codes)。换句话说,Web 服务器以成功或错误代码响应请求。
HTTP 状态码错误
HTTPS状态码是客户端向服务器发起请求时服务器发送的一条短信,显示在网页上。HTTPS状态代码对于网站所有者或任何开发人员都至关重要,因为它们在诊断客户端/服务器端错误和解决配置问题方面发挥着重要作用。换句话说,HTTPS状态代码是服务器表示某事不正确的方式。状态代码元素是一个 3 位数字,其中状态代码的第一个数字指定响应的类别。在该类中,存在各种服务器代码并由服务器返回。HTTPS状态码的最后两位数字没有任何分类作用。HTTP有五个标准类我们将详细讨论的状态代码,并讨论一些我们可能会定期遇到的HTTPS状态代码。(HTTPS)
HTTPS状态码分为 5 类:
1xx:
此类表示信息(Informational)响应,指示客户端发起的请求已被 Web 服务器接收并正在处理中。
在这个类中,存在各种服务器代码并由服务器返回。
以下是 1xx 类下的一些状态代码列表。
100 Continue:表示服务端在一个大请求中只收到了客户端发起的请求的一部分,表示只要请求没有被服务端拒绝,客户端就可以继续发送请求。
101 Switching Protocols:状态码表示服务器已准备好根据客户端的请求切换协议。
2xx:
该类是服务器返回的成功代码。这意味着客户端发起的请求被服务器接收到,并且动作被理解和处理。
以下是 2xx 类下的一些状态代码列表。
200 OK:此状态码是对客户端发起的成功HTTP请求的标准响应。当网页的行为与预期行为相同时,服务器会返回它。
201 Created:当客户端发起的请求被服务器完成并创建新资源时返回此状态码
205 Reset Content:当服务器成功完成客户端的请求但没有返回任何内容时返回此状态码。它需要客户端/浏览器重置文档视图。
3xx:
这个类是一个重定向(Redirection)代码,它建议客户端采取额外的行动来完成发起的请求。它表示客户端必须采取额外的行动来完成请求。
以下是 3xx 类下的一些状态代码列表。
300 Multiple Choices:表示客户端发起的资源的多选。客户端可以选择最多五个地址的链接。
301 Moved Permanently:当客户端发起的对资源或网页的请求被永久替换为另一个资源时,会显示此状态代码。它重定向到一个新的URL。
302 Found:当发现客户端发起的资源或网页请求但位于与预期不同的位置时,将显示此状态代码。它被临时移动到另一个资源或临时重定向到一个新的URL。
304 Not Modified:如果客户端自上次访问后已经下载了资源,则返回此状态码,并显示以通知客户端浏览器请求的资源已存储在未修改的浏览器缓存中。此状态码通过使用自上次访问后仍存在于缓存中的先前下载的副本,基本上加快了从网页传递资源的速度。
4xx:
客户端错误表示客户端的请求有问题。如果客户端的请求可能包含不正确的语法,则返回代码。
以下是 4xx 类下的一些状态代码列表。
400 Bad Request:如果由于客户端错误(如语法错误、欺骗性路由请求、无效帧等)而导致服务器未处理请求,则返回此状态码。
401 Unauthorized:如果客户端未提供有效的身份验证凭据,则服务器返回此状态代码。
403 Forbidden:当访问资源被禁止且客户端不具备查看内容所需的权限时,返回此HTTPS状态码。(HTTPS)如果客户端试图在没有有效登录凭据的情况下查看受密码保护的内容,这基本上会发生。
404 Not Found:此HTTPS状态代码错误是所有错误中最常见的错误,如果服务器未能找到客户端发起的请求,则会返回此错误。
405 Method Not Allowed:如果客户端请求的方法被托管服务器支持但客户端请求的资源不支持,则返回此HTTPS状态代码。(HTTPS)
408 Request Timeout:如果服务器未能接收到来自客户端浏览器的完整请求,则服务器返回此HTTPS状态代码。(HTTPS)此错误的主要原因是客户端-服务器之间的通信过程中数据包丢失。服务器超时等待从客户端浏览器完全接收请求。
410 Gone:如果服务器找不到客户端发起的请求页面或资源,则返回此HTTPS状态代码。(HTTPS)此状态错误类似于 404 Not Found错误,不同之处在于此错误是永久性的,并且请求的页面或资源现在不再可用,将来也不再可用。
5xx:
此类是服务器端错误,如果服务器未能满足客户端的请求,则会返回 - 服务器中的错误可能是阻止请求满足的原因之一。
以下是 5xx 类下的一些状态代码列表。
500 Internal Server Error:此HTTPS状态错误是由第三方插件或有故障的插件生成的。当服务器无法连接数据库并且无法交付请求的资源时,这是一个服务器错误。
501 Not Implemented:这是一个 Web 服务器问题,如果服务器不支持客户端请求的功能,则会返回错误。只有主机才能解决这个错误
502 Bad Gateway:此错误主要发生在向数据库请求资源的服务器将花费大量时间并被Web服务器本身取消最终断开与上游服务器或数据库的连接时。当服务器收到来自上游服务器的无效响应时,服务器会返回此错误。
503 Service Unavailable:服务(503 Service Unavailable:)端请求过多,无法及时处理,返回此错误。
504 Gateway Timeout :当作为网关的服务器没有收到上游服务器的响应时返回此错误。当客户端发起的请求涉及两个用于处理请求的服务器时,会发生这种情况,其中第一个服务器充当网关。第一台服务器将请求转发给第二台服务器,如果第一台服务器超时等待第二台服务器的响应,则返回错误。
我希望您发现这些信息很有用。(I hope you find this bit of information useful.)
What do common HTTP Status Code errors stand for?
HTTP is a simple communication protocol based on TCP/IP and is the absolute substratum for data delivery on the World Wide Web. For many years, HTTP is serving as a powerful protocol wherein bazillions of data is sent through HTTP between client and server. Essentially HTTP is based on a client-server architecture where web browsers and search engines act like an HTTP client and Web server acts as a server. This request/response by clients and server are communicated over a TCP/IP connection. The browser client initiates a request to a web server in the form of URL and the web server responds back with requested resources along with HTTPS status codes that are present in the browsers’ HTTP header. In other words, the web server responds to the request with success or error codes.
HTTP Status Code errors
HTTPS status code is a short note sent by the server that is displayed on the web page when the client initiates a request to the server. HTTPS status code is critical for websites owner or any developer as they play an important role in diagnosing the client/server side errors and resolving the configuration issues. In other words, the HTTPS status code is a server’s way of saying that something isn’t right. The status code element is a 3 digit number where the first digit of the status code specifies the classes of the responses. Within the class, a variety of server codes exists and is returned by the server. The last two digits of the HTTPS status code do not have any classification role. There are five standard classes for HTTP status codes which we are going to discuss in detail and discuss some HTTPS status codes that we may bump into on a regular basis.
HTTPS status codes are classified into 5 classes:
1xx:
This class signifies Informational responses which indicate that the client-initiated requests are received by the web server and is under process.
Within this class, a variety of server codes exist and are returned by the server.
The following are some of the lists of status codes under the class 1xx.
100 Continue: This indicates that the server received only a part of the client-initiated request out of a large request and it means that client can continue sending a request as long as the request is not rejected from the server end.
101 Switching Protocols: The status code mean that the server is ready to switch protocols as per the client’s request.
2xx:
This class is a success code returned by the server. It means that the client-initiated request was received by the server, as well as the action was understood and processed.
The following are some of the lists of status codes under the class 2xx.
200 OK: This status code is a standard response to the successful HTTP requests initiated by clients. It is returned by the server when the web page behaves the same way as it is expected to behave.
201 Created: This status code is returned when the client-initiated request is completed by the server and a new resource is created
205 Reset Content: This status code is returned when the server has successfully completed the client’s request but has failed to return any content. It requires the client/browser to reset the document view.
3xx:
This class is a Redirection code that suggests the client take the additional action to complete the initiated request. It indicates that the client must take additional action to complete the request.
The following are some of the lists of status codes under the class 3xx.
300 Multiple Choices: it indicates multiple choice for client-initiated resources. The client can select a link with a maximum of five addresses.
301 Moved Permanently: This status code is displayed when the client-initiated request for the resources or web page is permanently replaced with another resource. it redirects to a new URL.
302 Found: This status code is displayed when the client-initiated request for the resources or web page is found but at a different location than expected. It is temporarily moved to another resource or temporarily redirects to a new URL.
304 Not Modified: This status code is returned if the client has already downloaded resources since the last visit and is displayed to notify the client browser that the requested resources are already stored in the browser cache which hasn’t been modified. This status code basically speeds up the delivery of resources from the web page by using the previously downloaded copy that is still present in the cache since the last visit.
4xx:
The client-side error indicates that there was a problem with the client’s request. The code is returned if the client’s request may contain incorrect syntax.
The following are some of the lists of status codes under the class 4xx.
400 Bad Request: This status code is returned if the server did not process the request due to client error like wrong syntax, deceptive routing request, invalid framing, etc.
401 Unauthorized: This status code is returned by the server if a client has not provided valid authentication credentials.
403 Forbidden: This HTTPS status code is returned when the access to the resource is forbidden and a client does not possess required permission to view the content. This basically occurs if the client is attempting to view a password-protected content without valid login credentials.
404 Not Found: This HTTPS status code error is the most common error of all and is returned if the server fails to find the client-initiated request.
405 Method Not Allowed: This HTTPS status code is returned if the method requested by the client is supported by the hosting server but not supported by the resources requested by the client.
408 Request Timeout: This HTTPS status code is returned by the server if the server failed to receive a complete request from the client browser. The main reason for this error would be a loss of data packets during communication between client-server. The server times out waiting for the request to receive completely from the client browser.
410 Gone: This HTTPS status code is returned if the server fails to find the client-initiated request page or resources. This status error is similar to 404 Not Found error except that this error is permanent and the requested page or resources is no longer available for now and also will not be available again in the future.
5xx:
This class is a Server-side error and it is returned if the server failed to fulfill the client’s request – the error in the server may be one of reason preventing the fulfillment of the request.
The following are some of the lists of status codes under the class 5xx.
500 Internal Server Error: This HTTPS status error is generated by third-party plugins or faulty plugins. This is a server error when the server fails to connect the database and fails to deliver the requested resource.
501 Not Implemented: This is a web server issue an error is returned if the server does not support the functionality that was requested, by the client. This error can be resolved only the host
502 Bad Gateway: This error mostly occurs when the server that requests for the resources to the database will take a lot of time and is canceled by the web server itself eventually breaking the connection to the upstream server or a database. This error is returned by the server when it receives an invalid response from the upstream server.
503 Service Unavailable: This error is returned if the server is overloaded with too many requests and is unavailable to handle the requests in time.
504 Gateway Timeout: This error is returned when the server which is acting as a gateway fails to receive the response from an upstream server. It occurs when a client-initiated request involves two servers for processing the request wherein the first server acts as a gateway. The first server forwards the request to the second server and the error is returned if the first server timeout waiting for the response from the second server.
I hope you find this bit of information useful.