HTTP 学习笔记

 

HTTP

HTTP request: Every HTTP message sent from a web browser to a web server is classified as an HTTP request.

HTTP response: Every message sent from a web server to a web browser is classified as an HTTP response.

 

HTTP request

Request methods:

GET: A GET request is basically a request to receive the content located at a specific URL.

PST: It is commonly supported by browsers as a method of submitting form data, the browser will send the data from the form fields in a POST request.

PUT: It allows the web client to send content that will be stored on the web server. It behaviors like an update action on web server.

DELETE: It will specify the content on the web server to be deleted as the resource in the request line.

HEAD: The HEAD method is supposed to behave exactly like GET, except that the content is not present.

TRACE: TRACE is another diagnostic request method; this method allows the client to gain more perspective into any intermediary proxies that lie between the client and the server.

OPTION: It is used to identify the capabilities of the web server you want to interact with prior to actually making a request. List all the methods supported by web server.

CONNECT: The connect method is reserved explicitly for use by intermediary servers to create a tunnel to the destination server. The intermediary, not the http client issues the connect request to the destination server.

 

HTTP response

An HTTP response is broken into the following three logical pieces:

1.  status line 2. http headers 3. Content

 

There are three types of http headers in a response:

1.  General headers. 2. Response headers 3. Entity headers

 

 

你可能感兴趣的:(Web)