Hypertext Transfer Protocol (HTTP)

Source: Internet
Author: User

Hypertext Transfer Protocol

Scientific term definition

Chinese Name:

Hypertext Transfer Protocol

English Name:

Hypertext Transport Protocol; http

Definition:

A data transfer protocol that specifies the rules for communication between browsers and web servers over the Internet.

Application discipline:

Communication Technology (level 1); Communication Protocol (level 2)

HTTP protocol Overview

Hypertext Transfer Protocol (http-Hypertext Transfer Protocol)
Is the communication protocol between distributed, collaborative, and hypermedia system applications. It is the basis for World Wide Web information exchange. It allowsHypertext Markup Language
(HTML) documentation from the Web
Server transfer to Web
Browser. Html
Is a markup language used to create documents that contain links to relevant information. You can click a link to access other documents, images, or multimedia objects and obtain additional information about the link items.

2. simple and fast: when a customer requests a service from the server, they only need to send the request method and path. Common Request methods include get, Head, and post. Each method specifies the type of contact between the customer and the server. Because the HTTP protocol is simple, the program size of the HTTP server is small, so the communication speed is fast.

3. Flexibility: HTTP allows transmission of any type of data objects. The type being transferred is marked by Content-Type.

4. No connection: No connection means that only one request is allowed for each connection. After the server processes the customer's request and receives the customer's response, the connection is disconnected. This method can save transmission time.

5. Stateless: HTTP is stateless. Stateless means that the Protocol has no memory for transaction processing. The lack of status means that if subsequent processing requires the previous information, it must be re-transmitted, which may increase the amount of data transmitted each connection.

On the other hand, when the server does not need previous information, its response is faster.

Edit this sectionRequest Information

The request information includes the following:

● Request Line, such as get
/Images/logo.gif HTTP/1.1 indicates to request the logo.gif file from the/imagesdirectory.

● (Request) header, for example, accept-language:
En

● Empty rows

● Optional Message Body

The request line and title must end with <CR> <LF> (that is, press enter and then line feed ). The blank line must contain only <CR> <LF> and no other spaces. In HTTP/1.1, all request headers, except post, are optional.

Edit this sectionRequest Method

HTTP/1.1 defines eight methods (sometimes called "actions") to indicate the different operation methods of resources specified by request-Uri:

OptionsReturns the HTTP Request Method supported by the server for a specific resource. You can also use the '*' request sent to the Web server to test the server's functionality.

HeadRequest the server for the same response as the GET request, but the response body will not be returned. This method can obtain metadata contained in the Response Message Header without transmitting the entire response content.
GetSend a request to a specific resource. Note: The get method should not be used in operations that produce "Side effects", for example, in the Web
App. One of the reasons is that get may be randomly accessed by web spider.

PostSubmits data to a specified resource for processing (for example, submitting a form or uploading a file ). Data is contained in the request body. POST requests may result in creation of new resources and/or modification of existing resources.

Put
Upload the latest content to the specified resource location.

Delete
The request server deletes the resource identified by request-Uri.

Trace
The request received by the echo server is mainly used for testing or diagnosis.

Connect
The HTTP/1.1 protocol is reserved for proxy servers that can change connections to pipelines.

The method name is case sensitive. When the resource for a request does not support the corresponding request method, the server should return status code 405 (Method
Not allowed); when the server does not know or does not support the corresponding request method, the status code 501 (not implemented) should be returned ). The HTTP server should at least implement the get and head methods. Other methods are optional. Of course, the implementation supported by all methods should comply with the respective semantic definitions of the following methods. In addition to the preceding methods, the specific HTTP server can also extend the custom methods.

Edit this sectionSecure Hypertext Protocol

Secure Hypertext Transfer Protocol (S-HTTP) is a secure communication protocol designed in combination with HTTP. S-HTTP protocols provide a variety of security mechanisms for HTTP clients and servers that are applicable to a variety of users on the web. It also provides clients and servers with symmetric capabilities (timely request processing and recovery, and parameter selection between the two) while maintaining the HTTP Communication Model and implementation features. The S-HTTP does not require a proof of the customer's public key, but it supports a symmetric key operation mode. This means that private transactions will occur spontaneously without requiring the user to establish a public key. It supports end-to-end secure transmission. The client may first start secure transmission (using header information) to support encryption technology. Syntactically, A S-HTTP packet is the same as an HTTP packet and consists of a request line or status line followed by a header and body. The Request Message format consists of the request line, common information header, request header, entity header, and information subject. The corresponding message is composed of the response line, general information header, Response Header, entity header, and information subject. Currently, there are two methods to establish a connection:HTTPS
Uri scheme and HTTP 1.1 Request Header (introduced by rfc2817 ). Because the browser has almost no support for the latter, https
The URI scheme is still the main method for establishing secure hypertext protocol connections. Secure Hypertext connection uses https: // instead of http ://

My opinion: after reading this article, I will probably know what HTTP is, but I still want to know how to use it, in particular, the eight request methods options, Head, get, put, delete, trace, and connect have returned status codes.

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.