+++++++http Advanced HTTP Protocol Basics

Source: Internet
Author: User

URL Brief

Relative URL from current page

An absolute URL jumps from the current page or another page

httpd version <0.9 text ><1.0,method,mime, weak cache ><1.1 Persistent connection ><2.0,mime,spdy, cache,method>

HTTPD features: Stateless, Text Encoding protocol <telnet, Curl, enlinks>

Mechanisms for tracking user sources: Cookies (heavy cookies, light cookies), session

Cookie classification

Cookie working mechanism: The random number uniquely identifies the user

Light Cookie Application: Data structure preserves cookie and session mapping

HTTP transaction: One request and response

Transaction meta Data: headers

Entity: Entity-body

HTTP request Response message in detail:

<method> <url> <version>

...

Empty 1

Empty 2

<entity-body>


<version> <status> <reason-phrase>

...

Empty 1

Empty 2

<entity-body>


100 Information

OK Success

301 Moved permantly Permanent 302 Found temporary 304 not Modified condition

401 www-authenticate Challenge Authentication 403 Forbidden no permissions access 404 Not Found no resources

Internal Server Error Service internal error 502 Bad Gateway


URL Uniform Resource Locator identifies the location URL of each resource as a subset of the URI

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/07/73/wKiom1nJ-RDgjRdhAAA-u68AC_I008.png "style=" float : none; "title=" Qq20170926144952.png "alt=" Wkiom1nj-rdgjrdhaaa-u68ac_i008.png "/>

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/A6/24/wKioL1nJ-NXS1xyJAACC9wLjBC8129.png "style=" float : none; "title=" Qq20170926145043.png "alt=" Wkiol1nj-nxs1xyjaacc9wljbc8129.png "/>

relative URL : Relative to the URL of the current page (relative path: The path starting from the current working directory)

absolute URL : Used for cross-site references or the current page, (absolute path: From/to Path)

HTTPD version

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/A6/25/wKioL1nJ-bWwnqnDAAAszbo6oXQ354.png "title=" Qq20170926145446.png "alt=" Wkiol1nj-bwwnqndaaaszbo6oxq354.png "/>

HTTPD characteristics

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/07/73/wKiom1nJ-jXz_ZYOAAAWHLnJ7Ok403.png "title=" Qq20170926145553.png "alt=" Wkiom1nj-jxz_zyoaaawhlnj7ok403.png "/>

Mechanisms for tracking user sources

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/07/73/wKiom1nJ-oTzb3cHAAAHTu69TLE113.png "title=" Qq20170926145713.png "alt=" Wkiom1nj-otzb3chaaahtu69tle113.png "/>

How Cookies work

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/A6/25/wKioL1nJ_W-j4nQ2AADisY5AgIA700.png "title=" Picture 1.png "alt=" Wkiol1nj_w-j4nq2aadisy5agia700.png "/>

Two times communication:

The server receives a random number (token) <--The token that the client will access to the server for the first time to indicate its identity

Cookie classification

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/A6/25/wKioL1nJ_knDLRDUAAAlkc-4pAc492.png "title=" Qq20170926151404.png "alt=" Wkiol1nj_kndlrduaaalkc-4pac492.png "/>

Session :< Light cookies: Reduce the likelihood of loss of privacy information; in server-side maintenance session in process memory

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/A6/26/wKioL1nKACzjB7cDAAAprAAb4BM891.png "title=" Qq20170926152218.png "alt=" Wkiol1nkaczjb7cdaaapraab4bm891.png "/>


HTTP transactions httpd requests and responses at a time

Transaction metadata:(starting line +headers)

Entity:entity-body part


HTTP request Response Message detailed

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/A6/27/wKioL1nKCjmBW5eAAAAM3N4-Lu8364.png "title=" Qq20170926160506.png "alt=" Wkiol1nkcjmbw5eaaaam3n4-lu8364.png "/>


Request message

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/A6/26/wKioL1nKAlPRzSviAAARRu56gy8100.png "title=" Qq20170926153126.png "alt=" Wkiol1nkalprzsviaaarru56gy8100.png "/>

Response message

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/07/74/wKiom1nKAqywVdBHAAAWkJRJ9bg885.png "title=" Qq20170926153200.png "alt=" Wkiom1nkaqywvdbhaaawkjrj9bg885.png "/>


Method What the client tells the server to do

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/07/75/wKiom1nKBaGj_rUIAAAcdYi6Clg457.png "title=" Qq20170926154428.png "alt=" Wkiom1nkbagj_ruiaaacdyi6clg457.png "/>

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/07/75/wKiom1nKBb7BcWizAABioaqsCVI295.png "title=" Qq20170926154506.png "alt=" Wkiom1nkbb7bcwizaabioaqscvi295.png "/>

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/A6/26/wKioL1nKBbvhanV6AAAxM7P7-Vs104.png "title=" Qq20170926154603.png "alt=" Wkiol1nkbbvhanv6aaaxm7p7-vs104.png "/>

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/A6/26/wKioL1nKBdHyvTomAAA8r275sOE884.png "title=" Qq20170926154626.png "alt=" Wkiol1nkbdhyvtomaaa8r275soe884.png "/>

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/07/75/wKiom1nKBi_AXM-4AABSYtOtIb8282.png "title=" Qq20170926154659.png "alt=" Wkiom1nkbi_axm-4aabsytotib8282.png "/>

Status Code The server tells the client the result

Reason-phrase reason Phrases

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/A6/27/wKioL1nKCfnDMJQ7AAA7gHUxIlc298.png "title=" Qq20170926160338.png "alt=" Wkiol1nkcfndmjq7aaa7ghuxilc298.png "/>

Reverse Proxy: act as a server to receive requests, support caching, unpack messages and reseal

Forward Proxy: Act as a client-initiated request

redirect

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/07/75/wKiom1nKC-_x8tYoAAAhh9aM8Nw066.png "title=" Qq20170926161119.png "alt=" Wkiom1nkc-_x8tyoaaahh9am8nw066.png "/>

Conditional request

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/07/75/wKiom1nKDQDAKVABAAAcrcrqZSY284.png "title=" Qq20170926161602.png "alt=" Wkiom1nkdqdakvabaaacrcrqzsy284.png "/>


User Challenge Authentication

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/A6/27/wKioL1nKEJ_RfY8cAABfRT5vde0430.png "title=" Qq20170926163225.png "alt=" Wkiol1nkej_rfy8caabfrt5vde0430.png "/>


Forbidden request is forbidden, IP control or user access control is not outdated

404 user requests a non-existent resource


Error Gateway:

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/07/75/wKiom1nKCyiwOmz-AAArdZbEuwo524.png "title=" Qq20170926160809.png "alt=" Wkiom1nkcyiwomz-aaardzbeuwo524.png "/>




Headers Request and Response header: Metadata information for a property that marks a request or response, a transaction interchange

When load balancing is scheduled, it can be dispatched according to the header

1, the header can have multiple

2. Header format: Directive:value


First Part class

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/A6/27/wKioL1nKEmiA_Y_gAAAb_Bob7YQ259.png "title=" Qq20170926163954.png "alt=" Wkiol1nkemia_y_gaaab_bob7yq259.png "/>


General Header

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/A6/27/wKioL1nKErSyDWUqAAAxLomZ27M461.png "title=" Qq20170926164114.png "alt=" Wkiol1nkersydwuqaaaxlomz27m461.png "/>

Request Header

Own acceptable features

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/A6/28/wKioL1nKF6PzaFzBAABK9t0xRU8881.png "title=" Qq20170926170220.png "alt=" Wkiol1nkf6pzafzbaabk9t0xru8881.png "/>

Conditional Request Header: Cache-dependent

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/07/77/wKiom1nKGCCQ-9_LAAA19DhGWsw154.png "title=" Qq20170926170331.png "alt=" Wkiom1nkgccq-9_laaa19dhgwsw154.png "/>

Security Request Header

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/07/77/wKiom1nKGNqAK_99AAAWs2Nbg00161.png "title=" Qq20170926170630.png "alt=" Wkiom1nkgnqak_99aaaws2nbg00161.png "/>

Proxy request Header

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/A6/28/wKioL1nKGReBaSenAAAK9fBIGgM709.png "title=" Qq20170926170837.png "alt=" Wkiol1nkgrebasenaaak9fbiggm709.png "/>


Response header

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/A6/28/wKioL1nKGe7TdQ02AABKbEoprig846.png "title=" Qq20170926171212.png "alt=" Wkiol1nkge7tdq02aabkbeoprig846.png "/>


Entity Header

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/A6/2A/wKioL1nKIWOiVxRdAABjFnD7AY8390.png "title=" Qq20170926174356.png "alt=" Wkiol1nkiwoivxrdaabjfnd7ay8390.png "/>


Example

Request url:http://btn.siteuptime.com/genbutton.php?u=89773&m=101594&c=red&p=totalrequest  Method:GET                Method of       //Request status code:304 not modified            //The status code returned by the conditional request remote address:198.232.125.32:80        //server-side address    Cache-Control:max-age=86400             //control cache is in effect connection:keep-alive                   //Connection Status date:tue, 26 sep  2017 09:51:09 gmt      //Request Time expires:wed, 27 sep 2017  09:51:09 gmt   //Expiration Time Last-modified:tue, 26 sep 2017 03:39:50  gmt         //the last time the change occurred pragma:no-cache                                       //compatible with http/1.0 or http/1.1server:netdna-cache/2.2                               //Server program name and version number set-cookie:phpsessid= j7hlme3jhium3la0ibuh           //to the client's end token X-cache:hit                                            //Cache is hit  X-Frame-Options:SAMEORIGIN                        accept:image/webp,image/*,*/*;q=0.8                   Accept-encoding:gzip, deflate, sdchaccept-language:zh-cn,zh;q=0.8connection:keep-alivecookie: phpsessid=j7hlme3jhium3la0ibuh8es905         //sends Cookiehost to the server: btn.siteuptime.com                              //Service Host If-modified-since: tue, 26 sep 2017 03:39:50 gmt     //Conditional request Header: Since ... Time since ... Whether the cache has changed, expire,last-modifiedreferer:http://wowubuntu.com/markdown/basic.html    //the reference entry for this page  User-Agent:Mozilla/5.0  (windows nt 6.1; win64; x64)  //user Agent



This article is from the "Reading" blog, make sure to keep this source http://sonlich.blog.51cto.com/12825953/1968933

+++++++http Advanced HTTP Protocol Basics

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.