An HTTP request consists of a request method, a request URL, header fields, and a body. HTTP 1.1 defines the following request methods:
GET: Retrieves the resource identified by the request URL HEAD: Returns the headers identified by the request URL POST: Sends data of unlimited length to the Web server PUT: Stores a resource under the request URL DELETE: Removes the resource identified by the request URL OPTIONS: Returns the HTTP methods the server supports TRACE: Returns the header fields sent with the TRACE request
HTTP 1.0 includes only the GET, HEAD, and POST methods.
An HTTP response contains a result code, header fields, and a body. The HTTP protocol expects the result code and all header fields to be returned before any body content.
Some commonly used status codes include the following:
404: Indicates that the requested resource is not available 401: Indicates that the request requires HTTP authentication 500: Indicates an error inside the HTTP server which prevented it from fulfilling the request 503: Indicates that the HTTP server is temporarily overloaded, and unable to handle the request
本文介绍了HTTP请求的基本组成部分,包括请求方法如GET、POST等,以及HTTP1.0和HTTP1.1的区别。同时概述了HTTP响应的内容结构,包括常见的状态码如404、401、500和503等。
3万+

被折叠的 条评论
为什么被折叠?



