Web-----------HTTP protocol

Source: Internet
Author: User

one, HTTP protocol overview

HTTP Full name (Hypertext Transport Protocol), the Hypertext Transfer Protocol, which specifies the rules for communicating with each other between the browser and the World Wide Web server.

HTTP is a communication rule that specifies the format of the client-side content sent to the server, i.e. ( Request protocol ). Server-side content format to client, i.e. ( Response protocol )

Characteristics:

  HTTP is called Hypertext Transfer Protocol, which is based on the request mode and the response mode

HTTP is a stateless protocol

URL: Uniform Resource Locator, is a URL: protocol name:/ / domain : port / path,

Example:http://www.oldboy.cn:80/index.html

two, request agreement.

The request format is as follows:

1, request the first line  # Request Way Request path Protocol and version, for example: get/index.html http/1.1#//Request Header name: request header content, that is, the Key:value format , for example: Host:localhost3, empty line        # header information and request body split line 4, request body (Request data)#get no request body, only post has request body 

The browser sends the contents of the server to this format, if not this format the server will not be able to interpret! In the HTTP protocol, there are many request methods for requests, the most common of which is GET and POST. The difference between the different request methods is followed by a 1.1-point introduction.

2.1GET request  

The HTTP default request method is get
* No request body
* Data must be within 1K!
* GET request data is exposed in the browser's address bar

Get requests commonly used actions:
1. Give the URL directly in the address bar of the browser, then it must be a GET request
2. Clicking on a hyperlink on the page must also be a GET request
3. When submitting a form, the form uses the GET request by default, but can be set to post

Web-----------HTTP protocol

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.