HTTP message Structure

Source: Internet
Author: User

Ext.: http://www.runoob.com/http/http-messages.html

HTTP is an architecture model based on client/server (c/s) that exchanges information through a reliable link and is a stateless request/response protocol.

An HTTP "client" is an application (Web browser or any other client) that connects to the server to achieve the purpose of sending one or more HTTP requests to the server.

An HTTP "server" is also an application (typically a Web service, such as an Apache Web server or an IIS server) that receives requests from clients and sends HTTP response data to the client.

HTTP uses a Uniform Resource identifier (Uniform Resource Identifiers, URI) to transfer data and establish a connection.

Once the connection is established, the data message is routed through the format [RFC5322] and Multipurpose Internet Mail Extensions (MIME) [RFC2045] that are used by similar Internet mail.

Client Request message

The client sends an HTTP request to the server with a request message that includes the following format: A request line, a request header (header), a blank line, and four parts of the request data, giving the general format of the request message.

Server Response Message

The HTTP response is also made up of four parts: the status line, the message header, the blank line, and the response body.

Instance

The following example is a typical example of using get to pass data:

Client Request:

GET/Hello.TXT HTTP/1.1User-Agent: Curl/7.16. 3 Libcurl/7.16. 3 openssl/0.9.7l Zlib/1.2. 3host: Www. Example. Comaccept-language: En, mi           

Service-Side response:

HTTP/1.1 200OkDate: Mon, 27 Jul 2009 12:28:53GmtServer: ApacheLast-Modified: Wed, 22 Jul 2009 19:15:56 Gmtetag :  "34aa387-d-1568eb00"  Accept-ranges: Bytes Content-length: 51< Span class= "PLN" >vary: accept -encodingcontent-< Span class= "Typ" >type: Text/plain    

Output Result:

Hello World!  My payload includes a trailing CRLF.    

HTTP message Structure

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.