HTTP protocol Getting Started knowledge

Source: Internet
Author: User

HTTP Hypertext Transfer Protocol, is the client browser and server communication specification, is the browser and server communication protocol, belongs to the application layer of the Protocol, Web developers understand the HTTP protocol is very important. The browser requests the server through the HTTP protocol, completes the request server shuts down the connection immediately, frees the resources, therefore says the HTTP protocol is "stateless".

HTTP request:

The browser request server process is an HTTP request, and the HTTP request consists of three parts:

1 Request Lines

2 header of the request

3 Request for Package body

The header of the request-generally the default data, we do not set, this part is to tell the server browser some information, such as browser is what browser, requesting the server is which host and other information. Some message headers are optional, describing some of the client's environment information and the requested server address information.

Requested package body-as a web developer only need to know get/post request way, get or post to the server data is the request package body, this part is not necessary.

HTTP response:

1 Response Lines

2 header of the response

3 response of the package body

The header of the response and the part of the package we can set, the response of the Baotou tells the browser how to handle the data to be returned to the browser, so you must set the header of the response before the output content. This is why the header is not able to output content before it.

Common features of HTTP requests and responses

HTTP protocol Getting Started knowledge

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.