HTTP Protocol _ 01 _ Request/Response

Source: Internet
Author: User

HTTP Request

An HTTP request consists of three parts: request line, request header domain, and request body.

Agreed request Structure

Request Line

Method
SP Request-Uri
SP HTTP-version
CRLF

Request MethodMethod

Method

Description

Get

Resource identified by the request URI

Post

Request the resource identified by the URI and transmit data

Head

Request to obtain the Response Message Header of the resource identified by the URI

Put

Request to store a resource, similar to put in FTP

Delete

Request the server to delete the resource identified by the URI

Trace

Request Message received by the server

Connect

 

Options

 

Request Header domain

Request body

Data content transmitted to the server

Example

1,GetRequest,GetGenerally, requests do not contain Request body content.

2,PostRequest

3,ConnectRequest

HTTPResponse

HTTPThe response is also divided into three parts: Status line, Response Header domain, and response body.

Agreed response structure

Status line

HTTP-version
SP Status-code
SP Reason-phraseCRLF

Status Code

Status Code

Description

1 **

Indicates that the request has been received

2 **

Successful, indicating that the request has been successfully received, parsed, and processed

3 **

Redirection. Further operations must be performed to complete the request.

4 **

Client error. The client sent an invalid request.

5 **

A server error occurs. The server fails to process valid requests.

Response Header domain

Example

1Normal response

Materials

  1. Rfc2119/Rfc1945/Rfc2616
  2. Http://www.fiddler2.com/fiddler/help/http/headers.asp

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.