What is the request method for HTTP protocol HTTP protocol

Source: Internet
Author: User
Tags rfc

what is the HTTP protocol?

HTTP is an abbreviation for the Hyper Text Transfer Protocol (Hypertext Transfer Protocol). Its development was the result of collaboration between the World Wide Web Association (Wide) and the Internet Working Group IETF (Internet Engineering Task Force), which eventually released a series of RFC,RFC 1945 defines the http/1.0 version. The most notable of these is RFC 2616. RFC 2616 defines a version of--http 1.1 that is commonly used today.

Hypertext Transfer Protocol is a rule that specifies the communication between the browser and the World Wide Web server, and transmits the data transfer Protocol of the World Wide Web document over the Internet.

The HTTP protocol (hypertext Transfer Protocol, Hypertext Transfer Protocol) is the transfer protocol used to transfer the text from the WWW server to the local browser. It can make the browser more efficient and reduce the network transmission. It not only ensures that the computer transmits hypertext documents correctly and quickly, but also determines which part of the document is being transmitted, and which content is displayed first (such as text before graphics), and so on.

HTTP is an application-layer protocol that consists of requests and responses and is a standard client server model. HTTP is a stateless protocol.

 HTTP protocol Features

 The main features of the HTTP protocol can be summarized as follows:

1, support client/server mode.

2, simple and fast: When a customer requests a service from the server, it simply transmits the request method and path. The request method commonly has, POST. Each method specifies a different type of contact between the customer and the server. Because the HTTP protocol is simple, the HTTP server's program size is small, so the communication speed is fast.

3, Flexible: HTTP allows the transfer of any type of data objects. The type being transmitted is marked by Content-type.

4, no connection: The meaning of no connection is to limit the processing of one request per connection. When the server finishes processing the customer's request and receives the customer's answer, the connection is disconnected. In this way, the transmission time can be saved.

5, stateless: HTTP protocol is a stateless protocol. Stateless means that the protocol has no memory capacity for transactional processing. A lack of state means that if the previous information is required for subsequent processing, it must be re-routed, which may cause the amount of data to be transferred per connection to increase.

On the other hand, it responds faster when the server does not need the previous information.

  HTTP protocol Request Information

The request information sent includes the following:

A request line, such as Get/images/logo.gif http/1.1, represents a request logo.gif this file from the/images directory.

(request) header, e.g. Accept-language:en

Blank Line

The optional message body request line and caption must be terminated (that is, carriage return and then newline). There must be no more spaces in the empty line. In the http/1.1 protocol, all request headers, except post, are optional.

HTTP protocol Request method

The http/1.1 protocol defines eight methods (sometimes called "actions") to indicate the different modes of operation of the Request-uri specified resources:

Options returns the HTTP request method that the server supports for a specific resource. You can also test the functionality of your server with a request to send a ' * ' to the Web server.

  The head asks the server for a response that is consistent with the GET request, except that the response body will not be returned. This method allows you to obtain meta information contained in the response message header without having to transmit the entire response content.

  Get makes a request to a specific resource. Note: The Get method should not be used in operations that produce "side effects", such as in Web apps. One of the reasons is that get can be accessed by web spiders and other casual.

Post submits data to the specified resource for processing requests (such as submitting a form or uploading a file). The data is included in the request body. A POST request may result in the creation of new resources and/or modification of existing resources.

Put uploads its latest content to the specified resource location.

The delete request server deletes the resource identified by the Request-uri.

Trace echoes the requests received by the server, primarily for testing or diagnostics.

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

Method names are case-sensitive. When a request is directed to a resource that does not support the corresponding request method, the server should return the status Code 405 (method not allowed), and the Status Code 501 (not implemented) should be returned when the server does not recognize or support the corresponding request method.

The HTTP server should at least implement the get and head methods, and the other methods are optional. Of course, all methods that support implementations should conform to the respective semantic definitions of the methods described below. In addition, in addition to the methods described above, a specific HTTP server can also extend a custom method.

 Security protocols

The Secure Hypertext Transfer Protocol (secure hypertext Transfer Protocol, S-http) is a secure communication protocol for messages designed in conjunction with HTTP. The S-HTTP protocol provides a variety of security mechanisms for HTTP clients and servers that are applicable to various types of users on the web. It also provides the client and server with symmetric capabilities (processing requests and recoveries in a timely manner, and selecting parameters for both) while maintaining the HTTP communication model and implementation characteristics.

S-http does not require client-side public key attestation, but it supports the operating mode of the symmetric key. This means that private transactions occur spontaneously without requiring the user to establish a public key. It supports end-to-end secure transport, and the client may start the secure transfer (using the header information) to support encryption technology.

Syntactically, the s-http message is the same as HTTP, consisting of a request line or a status line, followed by an information header and a body. The format of the request message [2] consists of the request line, the general information header, the request header, the entity header, the information body. The response message is composed of response line, general information head, Response Head, entity header and information body.

There are currently two ways to establish a connection: the Httpsuri scheme and the HTTP 1.1 request header (introduced by RFC2817). Because the browser has little support for the latter, the HTTPS URI scheme is still the primary means of establishing a secure hypertext protocol connection. Secure hypertext connection protocol using https://instead of/HTTP

More content Reference: HTTP Protocol Learning Series

What is the request method for HTTP protocol 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.