HTTP Protocol Learning • Note one

Source: Internet
Author: User
Tags error status code

http version :0.9 version can only be text 1991 year end of TCP

1.0 Version: Mainstream support multimedia data processing keep-alive stay Connected

1.1 version: differentiate Persistent connection with 1.0 More request method Fine cache control, persistent connection

SMTP: The text that appears earlier can only be transferred

HTTP working mode: Operations on server resources

HTTPS transactions: request = = response to various types of request labeling is a variety of methods: such as various request methods GET PUT HEAD POST DELETE

HTTP Request packet: request

Message Format : <method>   Method Name <request-URL> Requesting Resources  can be relative path or absolute path <version>http protocol version

Request Header

<status>: Status Code

<reason-phrase>: reason phrases

<entiy-bady>: body part General Get method is empty response message inside there is subject

The four layers below the OSI are handled by the kernel , and IP MAC programs are not visible

Header Format :name:value

Content-type:images/gif

The first part three kinds:

General Header : Both requests and responses can be used

Connection: defines options for request response between C S

Via: Shows the middle node of the message passing through

Cache-contral: Cache indication

pragma

Request Header : Only requests are available

CLIENT_IP:

Host: the hostname and port number of the request

Referer: Jump Address

User-agent: What tools the user agent uses to make requests

Accept The first: the user indicates that the customer is more inclined to use the way

Response Header : Only responses are available

Entity Header : Used to specify entity properties

Extension Header : non-standard header, may be created by program developers such as x-forward-for

http Response Message : Response

<version> <status><reason-phrase>

<entity-body>

Response message Status code :

1xx Informational Status Code does not make much sense

2xx Success Status Code :OK 201:created

3xx redirect status code

301:movedpermanently Permanent redirect

302:Found Temporary redirect

304:not modified user requests resources for the second time indicates that the resource has not changed continue using the cache

4xx Error Status code Client Error:

403:Forbidden request denied

404 :not Found Server could not find the requested URL

405:method Not allowed does not promise to use this method to request a URL for a response

Error in 5xx server class

Server Internal Error

502 Bad GATEWAY Proxy Server received a pseudo response from upstream:

503 Serveice Unavailable: The server cannot provide service at this time but indicates that it may be available in the future

http a complete request process : 1. name resolution DNS resolution 2.   three-time handshake 3. Request Resources 4. four-time disconnection

HTTP protocol: is a stateless protocol: After the end of a transaction, regardless of the next few requests are reconnecting the server does not know that the client from the same connection is broken properties

Common Request Method:

Get (Request for a resource to be sent by the server)

HEAD( similar to get but does not require the server to send resources back to the response header only )

both of these are security methods: ( request not to modify resources only )

POST: ( support the HTML form submission, the form has the user fill in the data, this data will send the server side, the storage or to the processing program use )

PUT:( write a document to the server, publish the system, such as the network disk to upload the file )

Delete: (Request to delete the specified URL) OPTIONS(probe server support for a resource request method)

Trace : ( the firewall proxy or gateway that detects the proxy server trace request to go through, etc.)

extension methods: LOCK Mkcol COPY MOVE

Acceleration Mode:

1. multi-threaded, parallel request

2. three connection requests continuously open, persistent connection, maintain connection disadvantage: Consume server resources, time out and disconnect

Ten seconds to break the way everything is constantly compromised to get the best results ...

Base64 encodes the binary data into text and allows the receiver to format the original

Network programming:

C language has only data structures and no objects:

To be continued before the end ...


This article is from the "Home of Linux" blog, please be sure to keep this source http://pyhton.blog.51cto.com/8763915/1706186

HTTP Protocol Learning • Note one

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.