Notes-http protocol

Source: Internet
Author: User

Request:

Request Line --GET | post/1.html HTTP/1.1 // request method, page

Request Header--

Accept: text/html, image/* // tell the server the file format supported by the client

Accept-charset: UTF-8 // The encoding used by the client

Accept-encoding: gzip // client-supported Encoding

HOST: localhost // The host name that the client wants to access

If-modified-since: 18:00:00 GMT // tell the server the time point of the Client Cache

Referer: http: // www.xx.com/index.html // tell the server where the request is sent

User-Agent: chome/24 (compatible; MSIE 5.5; windows7) // tell the server about the client's software environment

Connection: Close | keep-alive // The connection is closed or maintained after connection.

Date: 18:00:00 GMT // request time

--- Empty row

Body --When the request is post, it can be used with data

-----------------------------------------------------------------------

Reponse:

Status line -- HTTP/1.1 200 OK // HTTP Version Status Code Description

1xx // the server has received the request, but the client can complete the following work only after another request

2XX // receives the request and responds successfully

3xx // The request fails. The client further requests

4xx // client Error

5xx // server error

Response Header -- // describe server information and notify the client to process data

Location: http://www.baidu.com // With 302 use tells client to request Baidu

Content-encoding:

Content-lenght

-- Empty line

Body -- // The data returned to the client

 

 

 

 

 

    

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.