HTTP鐨勪笘鐣岃
Posted IQ鍓嶇
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HTTP鐨勪笘鐣岃相关的知识,希望对你有一定的参考价值。
瑙傛劅搴︼細馃専馃専馃専馃専馃専
鍙e懗锛氶粦绯栫弽鐝?/span>
鐑归オ鏃堕棿锛?5min
鍓嶇鍦堟妧鏈殑鐖嗗彂寮忓闀块殢涔嬭€屾潵鐨勫紑鍙戜汉鍛樺涓嶅姩鐨勭柌鎯劅銆佺劍铏戞劅鍜屼笉鎯宠烦鍑鸿垝閫傚湀鐨勬嫋寤舵噿鎯般€?/p>
jQuery鍗庝附璋㈠箷锛孯eact v16宸茬粡鏅強銆丄ngular9鍜孷ue3鍗冲皢鍙戝竷銆備笁澶ф鏋惰秺鏉ヨ秺璐磋繎WebComponents鏍囧噯銆?span class="mq-24">TypeScript閬嶅湴寮€鑺憋紝灏忕▼搴忔棩鐩婄伀鐖嗭紝蹇簲鐢?PWA绱ч殢鍏跺悗鈥︹€?/span>
绔欏湪娴疆涔嬪穮鐨勬垜浠渶闇€瑕佺殑鏄仠涓嬫潵鎬濊€冿紝杞拌桨鐑堢儓鐨勬妧鏈湰璐ㄦ槸浠€涔堬紵
鍏跺疄锛岃桨杞扮儓鐑堢殑鎶€鏈湰璐紝鏄熀纭€鐭ヨ瘑鍜屾牳蹇冩蹇?/span>銆?/p>
鐪嬩綘杩欑瘒棰樼洰鐨勬枃绔狅紝鏄璁睭TTP鍜紵HTTP閭d箞绠€鍗曪紝鎴戜滑澶у姣忓ぉ閮界敤锛屾湁浠€涔堝ソ璁茬殑锛?/p>
鍦ㄥ仠涓嬫潵鎬濊€冩妧鏈湰璐ㄧ殑鍚屾椂锛屾垜浠篃瑕佷笉鏂殑鎻愰珮鑷繁鐨勮璇嗗眰娆★紝浣犳墍璋撶殑绠€鍗曟槸鍥犱负浣犳病鏈夊惉鍒扳€?span>閬ヨ繙鐨勫摥澹?/strong>鈥濄€?/p>
(shout out to 鐢风榛勬墽涓? 鎴戝皢甯︿綘浠嶩TTP鐨勫巻鍙插彂灞曞埌鍚勭増鏈凯浠d富瑕佺壒鎬ф潵浠庡叏灞€鐨勮搴﹂噸鏂拌璇咹TTP銆?/p>
1 HTTP鐨勪笘鐣岃 鍏堟潵鏄庣‘涓€涓嬫椂闂寸嚎锛屽洖鍒?0骞村墠鐨勯偅涓槬澶┿€?/p>
涓€鍒囩殑涓€鍒囬兘濮嬩簬1989骞寸殑3鏈堬紝涓囩淮缃戜箣鐖惰拏濮喡蜂集绾虫柉路鏉?Tim Berners-Lee)鐨勪竴绡囪鏂囷紝鍒涢€犱簡涓囩淮缃戯紝鍒涢€犱簡HTTP銆?/p>
1991骞?span class="mq-38">HTTP/0.9
鏈夎鎴戜滑浠婂ぉ鐨勪富瑙掔櫥鍦猴細HTTP
鍙戝竷 锛堟病鏈塕FC锛岀増鏈彿鏄悗鍔犱笂鍘荤殑锛?/p>
1996骞?鏈?span class="mq-40">HTTP/1.0鍦≧FC1945鍙戝竷
1997骞?鏈?span class="mq-42">HTTP/1.1鍙戝竷RFC2616鏄綋鍓嶆渶鏂扮増鏈?/span>
2014骞?span class="mq-44">HTTP/1.1鍐嶆淇锛屽皢澶ф枃妗f媶鍒嗕负鍏唤杈冨皬鐨勬枃妗o紝RFC7230-7235
2015骞?span class="mq-46">HTTP/2鍙戝竷RFC7540 (鍩轰簬璋锋瓕鐨凷PDY鍗忚)
2018骞达紝浜掕仈缃戞爣鍑嗗寲缁勭粐IETF鎻愯灏?span class="mq-49">HTTP over QUIC 鏇村悕涓?span class="mq-50">HTTP/3
濡傛灉甯屾湜鍏ㄩ潰鐨勪簡瑙?HTTP/3锛?/span>鎺ㄨ崘 Daniel Stenberg 锛圕URL 浣滆€咃級鐨凥TTP/3璇﹁В銆?/p>
褰撶劧濡傛灉浣犳兂鐪嬫渶鏂板悓姝ョ殑涓枃锛屽彲浠ョ湅鎴戠炕璇戠殑鐗堟湰HTTP/3璇﹁В銆?/p>
HTTP/3璇﹁В涓枃鐗?/p>
娆㈣繋鎸囨閿欒鍜孲tar銆?/p>
绾佃HTTP鐨勫巻鍙插彂灞曢暱娌筹紝绌跺叾鍘熷洜锛?span>鏄妧鏈拰闇€姹備竴鐩村湪鎺ㄥ姩鐫€瀹冪殑鍙戝睍銆?/span> 2 HTTP鏄粈涔堬紵 HTTP鏄竴涓湪璁$畻鏈轰笘鐣岄噷涓撻棬鍦ㄤ袱鐐逛箣闂翠紶杈撴枃瀛椼€佸浘鐗囥€侀煶棰戙€佽棰戠瓑瓒呮枃鏈暟鎹殑绾﹀畾鍜岃鑼冦€?/strong> HTTP閫氬父璺戝湪TCP/IP鍗忚鏍堜箣涓婏紝渚濋潬IP鍗忚瀹炵幇瀵诲潃鍜岃矾鐢便€乀CP鍗忚瀹炵幇鍙潬鏁版嵁浼犺緭銆丏NS鍗忚瀹炵幇鍩熷悕鏌ユ壘銆丼SL/TLS鍗忚瀹炵幇瀹夊叏閫氫俊銆傚綋鐒讹紝WebSocket銆丠TTPDNS渚濊禆浜嶩TTP銆?/p>
3 HTTP/0.9 HTTP/0.9褰撴椂鏄负浜嗗鏈氦娴侊紝鍩轰簬璇锋眰鍜屽搷搴旂殑妯″紡锛屽湪缃戠粶涓紶杈揌TML瓒呮枃鏈殑鍐呭銆?/p>
濡備笂鎵€绀猴紝鍙湁涓€涓姹傝锛屾病鏈塇TTP璇锋眰澶村拰璇锋眰浣撱€傚悓鏍凤紝鏈嶅姟鍣ㄤ篃娌℃湁鍝嶅簲澶翠俊鎭紝鍙槸杩斿洖浜嗘暟鎹€?/p>
鍥犱负閮芥槸HTML鏍煎紡鐨勬枃浠讹紝鍐冲畾浜嗚繑鍥炵殑鏂囦欢鍐呭閫氳繃ASCII瀛楃娴?/strong>杩涜浼犺緭銆?/p>
4 HTTP/1.0 1994骞翠綆寮€鍚嫧鍙蜂笂缃戯紝缃戞櫙涔熷湪鍚屽勾鎺ㄥ嚭浜嗙涓€娆炬祻瑙堝櫒锛屼汉浠涓囩淮缃戠殑闇€姹備笉鍐嶄粎灞€闄愪簬瀛︽湳浜ゆ祦銆?/p>
W3C鍜孒TTP宸ヤ綔缁?span>HTTP-WG涔熷湪杩欎釜鏃朵唬鍒涘缓銆備负浜嗘弧瓒充汉浠娴忚鍣ㄧ殑闇€姹?涓嶅厜鏄疕TML锛岃繕鏈塁SS銆丣S銆佸浘鐗囥€侀煶瑙嗛绛?锛屾枃浠舵牸寮忎笉鍐嶅眬闄愪簬ASCII缂栫爜銆?/p>
HTTP/1.0鐨勮В鍐冲姙娉曟槸寮曞叆浜?span>璇锋眰澶?/strong>鍜?span>鍝嶅簲澶?/strong>銆?/p>
鍚屾椂涔熷紩鍏ヤ簡鐘舵€佺爜锛屼负浜嗗噺杞绘湇鍔″櫒鐨勫帇鍔涳紝鎻愪緵浜?span>Cache鏈哄埗銆傛湇鍔″櫒闇€瑕佺粺璁″鎴风鐨勫熀纭€淇℃伅(Windows 鍜?macOS)锛屽姞鍏ヤ簡鐢ㄦ埛浠g悊瀛楁銆?/p>
5 HTTP/1.1 鏀硅繘鎸佷箙杩炴帴 涓€涓猅CP杩炴帴涓婂彲浠ヤ紶杈撳涓狧TTP璇锋眰锛屽彧瑕佹祻瑙堝櫒鎴栬€呮湇鍔″櫒娌℃湁鏂紑杩炴帴锛岃TCP浼氫竴鐩翠繚鎸併€?/p>
鎸佷箙杩炴帴鏄粯璁ゅ紑鍚殑锛屽鏋滄兂瑕佸叧闂紝鍦ㄨ姹傚ご涓姞涓?span>Connection:close鍗冲彲鍏抽棴銆?/p>
鐩墠娴忚鍣ㄤ腑瀵逛簬鍚屼竴涓煙鍚嶏紝榛樿鍏佽鍚屾椂寤虹珛6涓猅CP鎸佷箙杩炴帴銆?/p>
涓嶆垚鐔熺殑HTTP绠$嚎鍖?/span> HTTP/1.1 涓瘯鍥鹃€氳繃绠$嚎鍖栫殑鎶€鏈潵瑙e喅闃熷ご闃诲鐨勯棶棰樸€備絾鏄洜涓哄悇绉嶅師鍥狅紝琚悇澶у巶鍟嗘斁寮冩不鐤椾簡銆?/p>
澧炲姞瀵硅櫄鎷熶富鏈虹殑鏀寔 澧炲姞瀵瑰姩鎬佺敓浜у唴瀹圭殑鏀寔 HTTP/1.0闇€瑕佸湪鍝嶅簲澶翠腑璁剧疆瀹屾暣鐨勬暟鎹ぇ灏?span>Content-Length锛?00锛岃繖鏍凤紝娴忚鍣ㄥ氨鍙互鏍规嵁璁剧疆鐨勬暟鎹ぇ灏忔潵鎺ユ敹鏁版嵁銆?/p>
鐢变簬鏈嶅姟鍣ㄧ鎶€鏈彂灞曪紝椤甸潰閮芥槸鍔ㄦ€佺敓鎴愮殑锛屼紶杈撴暟鎹箣鍓嶅苟涓嶇煡閬撴渶缁堟暟鎹ぇ灏忥紝瀵艰嚧娴忚鍣ㄤ笉鐭ラ亾浣曟椂浼氭帴鍙楀畬鎵€鏈夌殑鏂囦欢鏁版嵁銆?/span> HTTP/1.1閫氳繃寮曞叆Chunk transfer鏈哄埗鏉ヨВ鍐抽棶棰橈紝鏈嶅姟鍣ㄥ皢鏁版嵁鍒嗗壊鎴愯嫢骞蹭釜浠绘剰澶у皬鐨勬暟鎹潡锛屾瘡涓暟鎹潡鍙戦€佹椂浼氶檮涓婁笂涓€涓暟鎹潡鐨勯暱搴︼紝鏈€鍚庝娇鐢ㄤ竴涓暱搴︿负0鐨勫潡浣滀负鍙戦€佹暟鎹畬鎴愮殑鏍囧織銆?/p>
瀹㈡埛绔疌ookie銆佸畨鍏ㄦ満鍒?/span> HTTP1.1寮曞叆浜?span>瀹㈡埛绔疌ookie鏈哄埗鍜?span>瀹夊叏鏈哄埗銆?/p>
6 HTTP/2.0 HTTP/1.1鐨勭己闄?/span> 瀵瑰甫瀹界殑鍒╃敤鐜囦笉鐞嗘兂锛?span class="mq-105">涓変釜闂瀵艰嚧锛?/span> TCP 鐨勬參鍚姩 鍚屾椂寮€鍚簡澶氭潯 TCP 杩炴帴锛岄偅涔堣繖浜涜繛鎺ヤ細绔炰簤鍥哄畾鐨勫甫瀹?/p> HTTP/1.1 闃熷ご闃诲鐨勯棶棰?/p> HTTP/2澶氳矾澶嶇敤 HTTP/2浣跨敤澶氳矾澶嶇敤鏈哄埗瑙e喅浜嗕笂杩伴棶棰樸€?/p>
涓€涓煙鍚嶅彧浣跨敤涓€涓?TCP 闀胯繛鎺ュ拰娑堥櫎闃熷ご闃诲闂銆傞€氳繃寮曞叆浜岃繘鍒跺垎甯у眰锛屽疄鐜颁簡 HTTP 鐨勫璺鐢ㄦ妧鏈€?/p>
HTTP/2鏈嶅姟鍣ㄦ帹閫?/span> 鏈嶅姟鍣ㄥ彲浠ユ彁鍓嶅皢鏁版嵁鎺ㄩ€佸埌娴忚鍣紝娴忚鍣ㄦ湁鏉冮€夋嫨鏄惁鎺ュ彈銆傛祻瑙堝櫒鍙戦€?span>RST_STREAM甯?/strong>鍙互閫夋嫨鎷掓敹銆?/p>
HTTP/2澶撮儴鍘嬬缉 澶撮儴鐨勫帇缂╁ぇ澶х殑鎻愬崌浜嗕紶杈撴晥鐜囥€侶TTP/2寮€鍙戜簡鈥淗PACK鈥濈畻娉曪紝鍦ㄥ鎴风鍜屾湇鍔″櫒寤虹珛鈥滃瓧鍏糕€濓紝鐢ㄧ储寮曞彿琛ㄧず閲嶅鐨勫瓧绗︿覆锛岃繕閲囩敤鍝堝か鏇肩紪鐮佹潵鍘嬬缉鏁存暟鍜屽瓧绗︿覆銆?/p>
HTTP/2鍙互璁剧疆璇锋眰鐨勪紭鍏堢骇 鍙互璁剧疆璁╂煇浜涢噸瑕佺殑鏁版嵁浼樺厛琚湇鍔″櫒澶勭悊骞惰繑鍥炪€?/p>
7 HTTP/3.0 HTTP/2鐨勭己闄?/span> TCP鐨勯槦澶撮樆濉?/span> 鍦?TCP 浼犺緭杩囩▼涓紝鐢变簬鍗曚釜鏁版嵁鍖呯殑涓㈠け鑰岄€犳垚鐨勯樆濉炵О涓?TCP 涓婄殑闃熷ご闃诲銆?/p>
HTTP/2鍙В鍐充簡搴旂敤灞傞潰鐨勯槦澶撮樆濉烇紝闃熷ご闃诲鐨勯棶棰樿繕瀛樺湪浜嶵CP鍗忚鏈韩銆?/p>
TCP寤虹珛杩炴帴鐨勫欢鏃?/span> TCP浠ュ強TCP+TLS寤虹珛杩炴帴鐨勬墍浜х敓鐨勫欢鏃朵篃鏄奖鍝嶄紶杈撴晥鐜囩殑涓€涓富瑕佸洜绱犮€?/p>
TCP鍗忚鍍靛寲 涓棿浠跺兊鍖?/strong> 鎴戜滑鎶婂湪浜掕仈缃戠殑鍚勫鎼缓鐨勮澶囧彨鍋氫腑闂磋澶?涓棿浠?锛屾瘮濡傝矾鐢卞櫒銆丯AT銆侀槻鐏銆佷氦鎹㈡満绛夛紝瀹冧滑閫氬父渚濊禆涓€浜涘緢灏戝崌绾х殑杞欢锛岃繖浜涜蒋浠朵娇鐢ㄤ簡澶ч噺鐨?TCP 鐗规€э紝璁剧疆涔嬪悗渚垮緢灏戣繘琛屾洿鏂般€傝繖灏卞鎴戜滑鎴戜滑鏇存柊TCP鐨勬椂鍊欓€犳垚浜嗗緢澶х殑鍥伴毦锛?span class="mq-129">鏂板崗璁殑鏁版嵁鍖呯粡杩囪繖浜涗腑闂翠欢鏃讹紝瀹冧滑涓嶄細鍘荤悊瑙e寘鐨勫唴瀹逛粠鑰屼涪寮冩帀杩欎簺鏁版嵁鍖呫€?/span> 鎿嶄綔绯荤粺 鍥犱负 TCP 鍗忚閮芥槸閫氳繃鎿嶄綔绯荤粺鍐呮牳鏉ュ疄鐜扮殑锛屽簲鐢ㄧ▼搴忓彧鑳戒娇鐢ㄤ笉鑳戒慨鏀广€傞€氬父鎿嶄綔绯荤粺鐨勬洿鏂伴兘婊炲悗浜庤蒋浠剁殑鏇存柊锛屾墍浠ユ兂瑕佹洿鏂版搷浣滅郴缁熷唴鏍镐腑鐨凾CP鍗忚涔熸槸闈炲父鍥伴毦鐨勩€?/p>
QUIC鍗忚 HTTP/3 閫夋嫨浜嗕竴涓姌琛风殑鏂规硶鈥斺€擴DP 鍗忚锛?span>鍩轰簬 UDP 瀹炵幇浜嗙被浼间簬 TCP 鐨勫璺暟鎹祦銆佷紶杈撳彲闈犳€х瓑鍔熻兘锛屾垜浠妸杩欏鍔熻兘绉颁负QUIC 鍗忚銆?/p>
瀹炵幇浜嗙被浼?TCP 鐨勬祦閲忔帶鍒躲€佷紶杈撳彲闈犳€х殑鍔熻兘 闆嗘垚浜?TLS 鍔犲瘑鍔熻兘 瀹炵幇浜?HTTP/2 涓殑澶氳矾澶嶇敤鍔熻兘 瀹炵幇浜嗗揩閫熸彙鎵嬪姛鑳?/p> 鍏充簬HTTP/3鏇村璇︾粏鐨勫唴瀹癸紝璇风Щ姝ユ垜缈昏瘧鐨勪腑鏂囩増鏈琀TTP/3璇﹁В銆?/p>
HTTP/3璇﹁В涓枃鐗?/p>
娆㈣繋Star鍜屾彁鍑洪敊璇垨涓嶅鐨勫湴鏂广€?/span> 浠撳簱閾炬帴 銆屸潳锔忓叧娉?鐐硅禐+鏀惰棌+璇勮+杞彂鉂わ笍銆?/strong>锛屽師鍒涗笉鏄擄紝榧撳姳绗旇€呭垱浣滄洿濂界殑鏂囩珷 以上是关于HTTP鐨勪笘鐣岃的主要内容,如果未能解决你的问题,请参考以下文章
GET/index.html
accept: text/html
accept-encoding: gzip, deflate, br
accept-Charset: ISO-8859-1,utf-8
accept-language: zh-CN,zh
缁撹
鍏抽敭璇?/code>鍏嶈垂棰嗗彇瑙嗛鏁欑▼
鎴戝井淇?/code>鎷変綘杩涙妧鏈氦娴佺兢
IQ鍓嶇
锛屾洿澶?
銆孋SS/JS寮€鍙戞妧宸с€?/strong>鍙湪鍏紬鍙锋帹閫?