Posted 绋嬪簭鍛樺搯鍟姊?/a>

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了相关的知识,希望对你有一定的参考价值。

鍓嶈█

澶у濂藉晩锛屾垜鏄悞鍎筐煈︼紝姣忓ぉ鍔姏涓€鐐圭偣馃挭锛屽氨鑳藉崌鑱屽姞钖煉板綋涓婃€荤粡鐞嗗嚭浠籆EO杩庡ǘ鐧藉瘜缇庤蛋涓婁汉鐢熷穮宄梆煑伙紝鎯虫兂杩樻湁鐐瑰皬婵€鍔ㄥ憿馃槑銆?/p>

杩欐槸鎴戠殑绗?2鏈熸枃绔犲唴瀹光湇锛屽笇鏈涜兘澶熸妸姣忎竴澶勭煡璇嗙偣锛岃鏄庣櫧锛岋紙褰撶劧锛屽鏋滃摢涓€澶勪笉浜嗚В锛屽彲浠ュ湪璇勮鍖鸿繘琛屾帰璁ㄥ摝锛侊級鈴帮紝璁℃椂寮€濮嬶紒

濡傛灉鎮ㄥ彂鐜版湰鏂囨湁甯姪锛岃鎮ㄧ偣璧烇紝鏀惰棌锛岃瘎璁猴紝鐣欎笅鎮ㄥ涔犵殑鑴氬嵃馃懀锛屾垜寰堜箰鎰忚皥璁吼煒?/p>

瀛︿範闃呰杩欑瘒鏂囩珷鍐呭杩樻槸闇€瑕佷竴鐐瑰墠绔綉缁滃熀纭€鐨勶紝鑷冲皯浣犵敤杩囨帴鍙o紝浜嗚В杩囧悗绔暐鐨勩€傦紙涔熶簡瑙h繃涓€鐐圭綉缁滅煡璇嗭紝浣嗕笉鎬庝箞浼氭噦鐨勫涔犺€咃級

瀛︿範Http鍗忚澶噸瑕佷簡锛屼簡瑙ttp鍗忚锛屽彲浠ヤ簡瑙eb搴旂敤绋嬪簭鍓嶅悗绔殑浜や簰绛?/p>

HTTP

浠€涔堟槸缃戠粶涓殑HTTP锛孒TTPS锛孒TTP2锛孌NS锛孴CP锛孋DN绛夌瓑锛屾偍鏄笉鏄惉寰椾竴澶撮浘姘村憿锛熷皬鏈嬪弸鎮ㄦ槸涓嶆槸鏈夊緢澶氶棶鍙凤紵馃槯

Web寤虹珛鍦℉TTP鍗忚涓婇€氫俊鐨?/p>

閭f垜浠厛浠嶩TTP鍗忚寮€濮嬶紝HTTP鍗忚锛?/p>

鐗圭偣锛?.绠€鍗曞揩閫燂紝2.鐏垫椿锛?.鏃犺繛鎺ワ紝4.鏃犵姸鎬侊紙HTTP鏄竴绉嶄笉淇濆瓨鐘舵€侊紝鏃犵姸鎬佸崗璁?浠嶩TTP/1.1 铏界劧鏄棤鐘舵€佸崗璁紝浣嗕负浜嗗疄鐜颁繚鎸佺姸鎬佸姛鑳斤紝寮曞叆浜?Cookie 鎶€鏈紝鏈変簡瀹冨氨鍙互绠$悊鐘舵€佷簡锛夈€傦紙璁颁綇鍜級

HTTP鎶ユ枃锛氳姹傛姤鏂囷紝鍝嶅簲鎶ユ枃

璇锋眰鎶ユ枃锛?/p>

  1. 璇锋眰琛岋細璇锋眰鏂规硶锛岃姹俇RL锛孒TTP鍗忚浠ュ強鐗堟湰锛?
  2. 璇锋眰澶达紝閫氱煡鏈嶅姟鍣ㄦ湁鍏充簬瀹㈡埛绔姹傜殑淇℃伅
  3. 绌鸿锛屽彂閫佸洖杞︾鍜屾崲琛岀

鍝嶅簲鎶ユ枃锛?/p>

  1. 鐘舵€佽
  2. 鍝嶅簲澶?
  3. 绌鸿
  4. 鍝嶅簲浣?

HTTP鏂规硶锛?/p>

涓昏GET鏂规硶鑾峰彇鏁版嵁锛孭OST鏂规硶浼犺緭璧勬簮

PUT鏂规硶鏇存柊璧勬簮锛孌ELETE鏂规硶鍒犻櫎璧勬簮锛孒EAD鏂规硶鑾峰緱鎶ユ枃棣栭儴

褰撶劧浣滀负绋嬪簭鍛樺父鐢ㄥ埌鐨凥TTP鐘舵€佺爜锛?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=
12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

鎻忚堪鍒拌繖閲屽簲璇ュぇ閮ㄥ垎浜轰篃鏄簡瑙h繖閮ㄥ垎姣旇緝鐨勬槸鍚э紵閭d箞鎺ヤ笅鏉ユ垜鏉ユ坊鍔犱竴浜涘唴瀹广€?/p>

绗竴姝ヰ煈o紝娴忚鍣ㄦ牴鎹姹傜殑url浜ょ粰dns鍩熷悕瑙f瀽锛屾壘鍒扮湡瀹炵殑Ip锛屽悜鏈嶅姟鍣ㄥ彂璧疯姹傘€?/p>

绗簩姝ヰ煈o紝鏈嶅姟鍣ㄤ氦缁欏悗鍙板鐞嗗悗锛岃繑鍥炲搷搴旂殑鏁版嵁锛屾祻瑙堝櫒鎺ユ敹鏂囦欢銆?/p>

绗洓姝ヰ煈o紝娴忚鍣ㄨ浇鍏ヨВ鏋愬埌鐨勮祫婧愭枃浠讹紝杩涜椤甸潰娓叉煋锛屽憟鐜板嚭web椤甸潰銆?/p>

so锛屽氨绠椾綘涓嶄簡瑙e叾杩愪綔鍘熺悊锛屼篃鏄兘澶熺湅鍒皐eb椤甸潰鐨勩€?/p>

so锛孒TTP鍗忚鏄秴鏂囨湰浼犺緭鍗忚锛屾槸鐢ㄤ簬浠庝竾缁寸綉鏈嶅姟鍣ㄤ紶杈撹秴鏂囨湰鍒版湰鍦版祻瑙堝櫒鐨勪紶杈撳崗璁€?/p>

HTTP鏄熀浜嶵CP/IP鍗忚閫氫俊鍗忚鏉ヤ紶閫掓暟鎹殑锛屼富瑕佹槸瀹㈡埛绔拰鏈嶅姟鍣ㄧ涔嬮棿鐨勯€氫俊鏍煎紡锛屼笉娑夊強鏁版嵁鍖呬紶杈撱€?/p>

閭d箞浠€涔堟槸缃戠粶鍩虹TCP/IP

缃戠粶鍩虹TCP/IP

褰撶劧璇村埌缃戠粶鍩虹TCP/IP锛屽氨瑕佷簡瑙d竴涓婽CP/IP鍗忚鏃忓暒锛?/p>

閫氬父浣跨敤鐨勭綉缁滄槸鍦ㄧ綉缁滃熀纭€TCP/IP鍗忚鏃忕殑鍩虹涓婅繍浣滅殑锛宻o锛屽姞涓婂垰鍒氭墍璇寸殑锛孒TTP灏辨槸瀹冨唴閮ㄧ殑涓€涓瓙闆嗭紙瀛愰泦锛熸暟瀛︽蹇碉級

鍗忚灏辨槸瀹氫箟瑙勫垯锛屽弻鏂硅瀹氫箟濂借鍒欙紝浜嬪厛纭畾锛屾墠鑳界浉浜掗€氫俊锛岀綉缁滃熀纭€TCP/IP鏄簰鑱旂綉鐩稿叧鐨勫悇绫诲崗璁棌鐨勬€荤О銆?/p>

鍦ㄥ浘瑙TTP涓紝TCP/IP鍗忚鏃忔槸鍒?灞傦細搴旂敤灞傦紝浼犺緭灞傦紝缃戠粶灞傚拰鏁版嵁閾捐矾灞傦紙鍒嗗眰鐨勶級銆?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

鍒╃敤TCP/IP鍗忚鏃忚繘琛岀綉缁滈€氫俊锛?/p>

閫氳繃鍒嗗眰椤哄簭涓庡鏂硅繘琛岄€氫俊锛屽彂閫佺锛堝鎴风锛変粠搴旂敤灞傚線涓嬭蛋锛屾帴鏀剁锛堟湇鍔″櫒绔級浠庨摼璺眰寰€搴旂敤灞備笂璧般€?/p>

鍗筹細瀹㈡埛绔紝搴旂敤灞傦紙HTTP瀹㈡埛绔級鉃★紝浼犺緭灞傦紙TCP锛夆灐锛岀綉缁滃眰锛圛P锛夆灐锛岄摼璺眰锛堢綉缁滐級鉃★紱鏈嶅姟鍣ㄧ锛屽簲鐢ㄥ眰锛圚TTP鏈嶅姟鍣ㄧ锛夛紝猬呬紶杈撳眰锛圱CP锛夛紝猬呯綉缁滃眰锛圛P锛夛紝猬呴摼璺眰锛堢綉缁滐級銆?/p>

浠庡彂閫佺鍒版帴鏀剁锛屽彂閫丠TTP璇锋眰娴佺▼锛?/p>

鍙戦€佺锛屾瘡閫氳繃涓€灞傚鍔犻閮紝鎺ユ敹绔紝姣忛€氳繃涓€灞傚垹闄ら閮ㄣ€傚彂閫佺鍙戣捣HTTP璇锋眰锛屼粠鍙戦€佺锛氬簲鐢ㄥ眰锛孒TTP鏁版嵁锛圚TTP鎶ユ枃锛夆灐锛屾帴鏀禩CP棣栭儴鍒颁紶杈撳眰锛屽嵆TCP棣栭儴鍖呭惈HTTP鏁版嵁鉃★紝鎺ユ敹IP鏁版嵁鍖呭埌缃戠粶灞傦紝鍗矷P棣栭儴閲屽寘鍚玊CP棣栭儴锛孴CP棣栭儴鍖呭惈HTTP鏁版嵁鉃★紝鎺ユ敹缃戠粶鏋舵瀯鍒伴摼璺眰锛屽嵆浠ュお缃戦閮ㄥ寘鍚獻P棣栭儴锛孖P棣栭儴閲屽寘鍚玊CP棣栭儴锛孴CP棣栭儴鍖呭惈HTTP鏁版嵁銆傚湪鍙戦€佺鏄繖鏍风殑浼犺緭銆?/p>

鎺ョ潃鍙戦€佺鐨勯摼璺眰浼犻€佸埌鎺ユ敹绔殑閾捐矾灞傦紝灏辨槸閫氳繃姣忎竴灞備細鍒犻櫎棣栭儴锛宻o锛屼紶杈撹繃鏉ョ殑HTTP鏁版嵁锛岋紙浠ュお缃戦閮煈塈P棣栭儴馃憠TCP棣栭儴馃憠HTTP鏁版嵁锛夛紝浠庡彂閫佺鍒版帴鏀剁锛屾帴鏀剁寰€涓婅蛋姣忎竴灞傚垹闄ら閮紙鍗抽摼璺眰鍒板簲鐢ㄥ眰锛夛紝so锛屾帴鏀剁鐨勯摼璺眰鍒扮綉缁滃眰鍒犻櫎棣栭儴鍚庯紙P棣栭儴馃憠TCP棣栭儴馃憠HTTP鏁版嵁锛夛紝涓€娆$被鎺紝鍒版帴鏀剁鐨勫簲鐢ㄥ眰灏卞墿涓婬TTP鏁版嵁銆?/p>

閭d箞鏈変汉璇达紝鍦ㄨ绠楁満缃戠粶鐨勪竷灞傚崗璁憿锛熸槸鐨勬湁涓冨眰锛屼笉杩囬兘涓嶄細褰卞搷鐨勶紝璇翠竴璇翠竷灞傚崗璁紝椤哄甫璁茶銆?/p>

鍦ㄤ富鏈轰笂锛氬簲鐢ㄥ眰锛岃〃绀哄眰锛屼細璇濆眰锛屼紶杈撳眰锛涘湪缃戠粶涓婏細缃戠粶灞傦紝閾捐矾灞傦紝鐗╃悊灞傘€?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

浠ヤ笂鍙互涓€閮ㄥ垎涓€閮ㄥ垎杩涜瀛︿範鎺屾彙鐨勭煡璇嗙偣銆?/p>

HTTP 涓?GET 涓?POST 鐨勫尯鍒?/h4>

鍦ㄧ綉涓婂啿娴椂锛岀湅鍒般€?9%鐨勪汉閮界悊瑙i敊浜咹TTP涓璆ET涓嶱OST鐨勫尯鍒€嬭繖绡囨枃绔犮€?/p>

璇碐ET鍜孭OST鏈変竴涓噸澶у尯鍒紝GET浜х敓涓€涓猅CP鏁版嵁鍖咃紱POST浜х敓涓や釜TCP鏁版嵁鍖呫€?/p>

鍦℅ET璇锋眰锛屾祻瑙堝櫒浼氭妸http header鍜宒ata涓€骞跺彂閫佸嚭鍘伙紝鏈嶅姟鍣ㄥ搷搴?00锛岃€屽浜嶱OST锛屾祻瑙堝櫒鍙戦€乭eader锛屾湇鍔″櫒鍝嶅簲100 continue锛屾祻瑙堝櫒鍐嶅彂閫乨ata锛屾湇鍔″櫒鍝嶅簲200銆?/p>

鐒跺悗鐪嬪埌杩欑瘒鏂囩珷銆婂惉璇淬€?9% 鐨勪汉閮界悊瑙i敊浜?HTTP 涓?GET 涓?POST 鐨勫尯鍒€忥紵锛熴€嬬粨璁烘槸锛屽叧浜庛€嶨ET 鍙戜竴涓寘锛孭OST 鍙戜袱涓寘銆忕殑鐭ヨ瘑 99% 澶ф鏄粠杩欑瘒鏂囩珷涓緱鏉ョ殑銆奨MLHttpRequest (XHR) Uses Multiple Packets for HTTP POST?銆嬪彲浠ヨ嚜宸辨煡鐪嬪摝锛侊紙澶氬鎻愬嚭鑷繁鎬濊€冿紝涓嶆柇闂负浠€涔堬紝鍘绘墿灞曡嚜宸辩煡璇嗙偣鐨勮竟缂橈級

涓€涓猅CP杩炴帴鑳藉彂澶氬皯涓狧TTP璇锋眰

so锛屼竴涓猼cp杩炴帴閲屽埌搴曡兘鍙戝嚑涓猦ttp鍛紵馃槈锛屽簲璇ユ槸tcp杩炴帴涓嶆柇寮€锛屽氨鍙互涓€鐩村彂閫佽姹傦紝涓嶆柇寮€灏卞彲浠ラ殢渚垮彂锛孒TTP2鐨勮瘽鍙互涓€涓繛鎺ラ噷骞惰锛孒TTP/1.1涓嶈鐨勩€傦紙寮€浜哖ipelining灏卞彲浠ヤ簡鍚э紝http1.1鐨勶紝浣嗘槸 Pipelining 榛樿鍦ㄦ祻瑙堝櫒鏄笉寮€鐨勶級

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

锛堟劅瑙夊簲璇ュ拰缃戠粶鐘跺喌鐩稿叧锛屼笉浼氬瓨鍦ㄤ竴瀹氫竴绉嶆瘮鍙︿竴绉嶅揩锛?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

涓€涓?TCP 杩炴帴鍚庢槸鍚︿細鍦ㄤ竴涓?HTTP 璇锋眰瀹屾垚鍚庢柇寮€锛?/h4>

鍦?HTTP/1.0 涓紝涓€涓湇鍔″櫒鍦ㄥ彂閫佸畬涓€涓狧TTP鍝嶅簲鍚庯紝浼氭柇寮€TCP閾炬帴銆備絾杩欐牱璇锋眰浼氶噸鏂板缓绔嬪拰绔彛TCP杩炴帴锛屼唬浠疯繃澶с€?/p>

濡傛灉鏌愭湇鍔″櫒瀵笴onnection: keep-alive 鐨?Header 杩涜浜嗘敮鎸併€傝〃绀哄畬鎴愯繖涓狧TTP璇锋眰鍚庯紝涓嶇敤鏂紑HTTP璇锋眰浣跨敤TCP鐨凾CP杩炴帴锛屽彲浠ヨ閲嶅浣跨敤锛屼箣鍚庡彂閫丠TTP璇锋眰灏变笉鐢ㄩ噸鏂板缓绔婽CP杩炴帴浜嗐€?/p>

缁存寔杩炴帴濂藉澶氬锛岄偅涔堝湪HTTP/1.1 灏辨妸 Connection 澶村啓杩涙爣鍑嗭紝闄ら潪鍏抽棴锛屽惁鍒欎細缁存寔涓€娈垫椂闂寸殑TCP杩炴帴锛岄粯璁ゆ儏鍐典笅杩炴帴TCP涓嶄細鏂紑锛屽彧鏈夊湪璇锋眰鎶ュご涓0鏄嶤onnection: close 鎵嶄細鍦ㄨ姹傚畬鎴愬悗鍏抽棴杩炴帴銆?/p>

濡傛灉缁存寔杩炴帴锛屼竴涓?TCP 杩炴帴鏄彲浠ュ彂閫佸涓?HTTP 璇锋眰鐨勩€?/p>

涓€涓?TCP 杩炴帴涓?HTTP 璇锋眰鍙戦€佸彲浠ヤ竴璧峰彂閫佷箞?

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

鍦≒iPelining鏉ヨВ鍐宠繖涓棶棰橈細锛圥ipelining 鏄粈涔堬級

濡傚浘锛?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=
12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=
12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

杩欎竴闂瑙e喅鍚庯紝涓嬮潰浜嗚В涓€涓婭P,TCP,鍜孌NS(鍏堢畝鍗曡鏄庝竴涓嬶紝杩樺彲鑳藉啀鍔犳繁)

IP,TCP,鍜孌NS

璇村埌IP锛孴CP锛孌NS杩欎笁涓崗璁紝褰撶劧鍦ㄧ綉缁滈€氫俊涓紝灞傛鏈夋秹鍙婂埌鎵€浠ヨ璇翠竴涓嬪惁鍒欏氨蹇樿浜嗐€?/strong>

TCP/IP 鏄竴绫诲崗璁郴缁燂紝瀹冩槸鐢ㄤ簬缃戠粶閫氫俊鐨勪竴濂楀崗璁泦鍚?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

tcp鐨勯閮ㄦ牸寮?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

棣栭儴鏍煎紡

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

鏁版嵁鍖咃細

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

TCP鍗忚鐢ㄤ簬淇濊瘉鍙潬鎬э紝浣嶄簬浼犺緭灞傦紝鎻愪緵瀛楄妭娴佹湇鍔?/p>

瀛楄妭娴佹湇鍔℃槸灏嗗ぇ鍧楁暟鎹垎鍓叉垚浠ユ姤鏂囨浣嶅崟浣嶇殑鏁版嵁鍖呰繘琛岀鐞嗭紙涓昏鏄负浜嗘柟渚夸紶杈擄級銆?/p>

鑰岃繖閲岀‘淇濇暟鎹彲闈犳€ч€佽揪锛岃繖閲屽氨鏄垜浠父璇寸殑TCP鍗忚閲囩敤浜嗕笁娆℃彙鎵嬶紝鐢ㄤ簬淇濊瘉鏁版嵁鍑嗙‘鏃犺鐨勯€佸埌鐩殑鍦般€傦紙TCP寤虹珛杩炴帴鈥斾笁娆℃彙鎵嬶紝TCP閲婃斁杩炴帴鈥斿洓娆℃尌鎵?寰呬細璇?锛?/p>

涓夋鎻℃墜,鍥涙鎸ユ墜

鎻℃墜杩囩▼涓娇鐢ㄤ簡TCP鏍囧織锛孲YN锛坰ynchronize锛夊悓姝ヤ俊鍙峰拰ACK锛坅cknowledgement锛夌‘璁や俊鍙枫€?/p>

鎻忚堪杩囩▼鏄細锛堜笁娆℃彙鎵嬶級

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=
12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

绗竴娆℃彙鎵嬶細鍙戦€佺锛屾妸鏍囨湁SYN鐨勬暟鎹寘鍙戠粰鍒?鎺ユ敹绔紝绛夊緟瀵规柟鎺ユ敹銆?/p>

绗簩娆℃彙鎵嬶細鎺ユ敹绔帴鏀跺悗锛屽彂閫佹爣鏈?SYN/ACK 鐨勬暟鎹寘缁欎互绀轰紶杈剧‘璁や俊鎭€?/p>

绗笁娆℃彙鎵嬶細鍙戦€佺鏀跺埌鍚庯紝鍦ㄤ紶鍥炲甫ACK鏍囪瘑鐨勬暟鎹寘缁?鎺ユ敹绔紝鎻℃墜鎺ユ敹銆?/p>

鍙戦€佺锛屾妸鏍囨湁SYN鐨勬暟鎹寘鍙戠粰鍒?鎺ユ敹绔紝鎺ユ敹绔敹鍒板悗锛屽彂閫佹爣鏈?SYN/ACK 鐨勬暟鎹寘缁?鍙戦€佺锛屽彂閫佺鏀跺埌鍚庯紝鍙戦€佹爣鏈?ACK鐨勬暟鎹寘缁?鎺ユ敹绔€?/p>

濡傚浘锛氾紙SYN銆丄CK 鏄?TCP 灏佸寘涓殑 鎺у埗浣嶅厓 锛?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=
12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

鎻忚堪杩囩▼鏄細鍥涙鎸ユ墜

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=
12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=
12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=
12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

so锛岃繖灏遍渶瑕丏NS鏈嶅姟鏉ヨ礋璐e煙鍚嶈В鏋愩€?/p>

DNS鏈嶅姟鏉ヨ礋璐e煙鍚嶈В鏋?/h4>

璐熻矗鍩熷悕瑙f瀽鐨?DNS 鏈嶅姟,灏辨槸閫氳繃鍩熷悕鏌ヨ鍒板叿浣撶殑 IP銆?/p>

褰撳鎴锋満鎻愬嚭鏌ヨ璇锋眰鏃讹紝浼氬湪鏈湴璁$畻鏈轰腑鐨勭紦瀛樹腑鏌ユ壘锛屽鏋滃湪鏈湴鏃犳硶鑾峰彇鏌ヨ淇℃伅锛屽氨灏嗘煡璇㈣姹傚彂缁橠NS鏈嶅姟鍣ㄣ€?/p>

so锛屾牴鎹笂杩版€荤粨锛屾垜鍙互鎻忚堪HTTP鍗忚鐨勯€氫俊杩囩▼锛?/strong>

HTTP鍗忚鐨勯€氫俊杩囩▼

杩欎釜杩囩▼灏辨槸浠庡簲鐢ㄥ眰锛屼紶杈撳眰锛岀綉缁滃眰锛岄摼璺眰涔嬮棿鐨勪紶閫掋€?/p>

鍦ㄨ繖閲岃鍒板鎴风鍙戦€丠TTP璇锋眰缁欐湇鍔″櫒绔殑璇锋眰鎶ユ枃鏄粈涔堬紵

鍥犱负涓婇潰璇村埌灏辫涓€涓嬭姹傛姤鏂囷紝閭d箞璇锋眰鎶ユ枃鏄涓嬪浘鏁翠綋锛?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

杩欐槸瀹㈡埛绔殑璇锋眰鎶ユ枃锛岄偅涔堟湇鍔″櫒绔篃鏈夛紝鏄帴鏀跺悗缁撴灉浠ュ搷搴旀姤鏂囧舰寮忚繑鍥烇細

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

鐢ㄨ〃鏍硷紝鎻忚堪GET鐢ㄤ簬鑾峰彇璧勬簮锛?/p>

璇存槑 鎻忚堪
璇锋眰 GET /index.html HTTP/1.1
鍝嶅簲 杩斿洖index.html鐨勯〉闈㈣祫婧?/td>

so锛孒TTP鎶ユ枃鐢ㄤ簬HTTP鍗忚浜や簰鐨勪俊鎭紝鎶ユ枃鏄敱澶氳鏁版嵁鏋勬垚鐨勫瓧绗︿覆鏂囨湰銆傚ぇ鑷村垎鎶ユ枃棣栭儴鍜屾姤鏂囦富浣撲袱鍧椼€?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

鎶ユ枃鐨勭粨鏋?/h4>

璇锋眰鎶ユ枃鍜屽搷搴旀姤鏂囩殑缁撴瀯锛堟壘浜嗗涓嬪浘鐗囪繘琛岃В閲婏級

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=
12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

褰撶劧濡傛灉杩樹笉澶熸竻鏅帮紝鍐嶆鎵句簡鍑犲紶鍥剧墖锛?/p>

璇锋眰澶?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

璇锋眰浣?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

鐘舵€佽

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

鍝嶅簲澶撮儴

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

鍝嶅簲浣?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

URI

璇村埌url锛屾垜浠浜嗚В涓€涓婾RI,瀹冩槸鍚屼竴璧勬簮鏍囪瘑绗?/strong>銆備簡瑙d竴涓?span class="mq-215">缁濆URI鐨勬牸寮?/strong>銆?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

URI涓€鑸兘鏄畾浣嶄簰鑱旂綉涓婄殑璧勬簮锛屼繚璇佸湪浜掕仈缃戜笂浠绘剰浣嶇疆鐨勮祫婧愯繘琛岃闂紙HTTP鍗忚浣跨敤URI璁╁鎴风瀹氫綅鍒拌祫婧愶級銆傚涓嬪浘锛?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

蹇€熺湅鍒拌繖閲岀殑鏈嬪弸搴旇瀵笻TTP浜嗚В杩樺緢涓嶉敊鍛€?/p>

GET鍜孭OST鐨勫尯鍒紵

鏉ラ亾甯歌€冮潰璇曢锛欸ET鍜孭OST鐨勫尯鍒紵

  1. GET鍦ㄦ祻瑙堝櫒鍥為€€涓嶄細鍐嶆璇锋眰锛孭OST浼氬啀娆℃彁浜よ姹?
  2. GET璇锋眰浼氳娴忚鍣ㄤ富鍔ㄧ紦瀛橈紝POST涓嶄細锛岃鎵嬪姩璁剧疆
  3. GET璇锋眰鍙傛暟浼氳瀹屾暣淇濈暀鍦ㄦ祻瑙堝櫒鍘嗗彶璁板綍閲岋紝POST涓殑鍙傛暟涓嶄細
  4. GET璇锋眰鍦║RL涓紶閫佺殑鍙傛暟鏄湁闀垮害闄愬埗鐨勶紝鑰孭OST娌℃湁闄愬埗
  5. GET鍙傛暟閫氳繃URL浼犻€掞紝POST鏀惧湪Request body涓?

HTTP鍥涗釜鐗堟湰

鍒嗗埆鏄疕TTP1.0銆丠TTP1.1銆丠TTP/2锛孒TTP/3

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

HTTP1.0榛樿鏄煭杩炴帴锛屾瘡娆′笌鏈嶅姟鍣ㄤ氦浜掞紝閮介渶瑕佹柊寮€涓€涓繛鎺ャ€?/p>

HTTP1.1鐗堟湰,榛樿鎸佷箙杩炴帴锛屽彧瑕佹病鏈夋槑纭彁鍑虹鍙e氨涓€鐩翠繚鎸侊紝鍙互鍙戦€佸娆TTP璇锋眰锛岃繕鏈夐噸鐐瑰湪浜庢柇鐐圭画浼狅紝鍒╃敤HTTP娑堟伅澶翠娇鐢ㄥ垎鍧椾紶杈撶紪鐮侊紝灏嗗疄浣撲富浣撳垎鍧椾紶杈撱€?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=
12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

https鍗忚鐜板湪閮ㄥ垎缃戠珯閮界敤杩欎釜銆?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=
12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

鍦ㄧ綉缁滀笂锛屽鎴风鍜屾湇鍔$浜や簰锛屽氨鏈夊彲鑳借鎸熸寔锛岄渶瑕佺敤CA锛堝叕淇℃満鏋勶級鏉ュ府瀹㈡埛绔瀹氭湇鍔$鏄湡瀹炵殑銆?/p>

杩欎釜鏃跺€欏氨瑕佸幓鐢宠涓€浠芥暟瀛楄瘉涔︼紝鏁板瓧璇佷功閲屾湁璇佷功鎸佹湁鑰呫€佽瘉涔︽湁鏁堟湡銆佹湇鍔″櫒鍏挜绛変俊鎭€?/p>

瀹㈡埛绔敤CA鐨勫叕閽ュ璇佷功瑙e瘑锛堣瘉涔﹁CA鏈烘瀯鐨勭閽ヨВ瀵嗭紝鐒跺悗瀹㈡埛绔敤CA璇佷功鐨勫叕閽ヨВ瀵嗐€傦級

娴佺▼濡備笅鍥炬墍绀猴細

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=
12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

绠$嚎鍖栧拰鎸佷箙杩炴帴

浠呭湪HTTP/1.1鎵嶆敮鎸佺绾垮寲锛屽湪鎸佷箙杩炴帴鍓嶆彁涓嬶紝璇锋眰涓€娆℃€ф墦鍖呬紶杈撹繃鍘伙紝鍝嶅簲涓€娆℃€ф墦鍖呬紶閫掑洖鏉ャ€?/p>

绠$嚎鍖栨妧鏈殑鍑虹幇锛屼笉鐢ㄧ瓑寰呭搷搴斾害鍙洿鎺ュ彂閫佷笅涓€涓姹傘€?/p>

鍦℉TTP1.1涓墍鏈夐摼鎺ラ粯璁ら兘鏄寔涔呰繛鎺ワ紝浣跨敤鍚屼竴涓猅CP杩炴帴鏉ュ彂閫佸拰鎺ユ敹澶氫釜HTTP璇锋眰鎴栧搷搴斻€?/p>

鎸佷箙杩炴帴锛圚TTP Persistent Connections锛屼篃绉颁负 HTTP keep-alive 鎴?HTTP connection reuse锛?/p>

濂藉锛?/p>

  1. 鍑忓皯浜?TCP 杩炴帴鐨勯噸澶嶅缓绔嬪拰鏂紑鎵€閫犳垚鐨勯 澶栧紑閿€
  2. 鍑忚交浜嗘湇鍔″櫒绔殑璐熻浇
  3. Web 椤甸潰鐨勬樉绀洪€熷害鎻愰珮浜?

Cookie浜嗚В涓€涓?/h4>

Cookie 鎶€鏈€氳繃鍦ㄨ姹傚拰鍝嶅簲鎶ユ枃涓啓鍏?Cookie 淇?鎭潵鎺у埗瀹㈡埛绔殑鐘舵€?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

璺ㄥ煙

浠€涔堟槸鍚屾簮绛栫暐

鍚屾簮绛栫暐鏄竴绉嶇害瀹氾紝瀹冩槸娴忚鍣ㄦ渶鏍稿績鐨勫畨鍏ㄥ姛鑳斤紝鎵€璋撳悓婧愭槸鎸?鍗忚+鍩熷悕+绔彛"涓夎€呯浉鍚屻€?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

璺ㄥ煙鏄姹傝兘鍙戝嚭鍘伙紝鏈嶅姟绔兘鏀跺埌璇锋眰骞舵甯歌繑鍥炵粨鏋滐紝鍙槸缁撴灉琚祻瑙堝櫒鎷︽埅浜嗐€?/p>

瑙e喅璺ㄥ煙锛?/p>

鏈?jsonp銆乮frame銆乧ors銆乮mg銆丠TML5 postMessage绛夌瓑銆傚叾涓敤鍒?html 鏍囩杩涜璺ㄥ煙鐨勫師鐞嗗氨鏄?html 涓嶅彈鍚屾簮绛栫暐褰卞搷銆備絾鍙槸鎺ュ彈 Get 鐨勮姹傛柟寮忥紝杩欎釜寰楁竻妤氥€?/p>

JSONP鍘熺悊锛屽埄鐢╦s璇锋眰杩斿洖涓嶉渶瑕佸煙鍚嶏紝娌℃湁璺ㄥ煙闂锛屽嵆鍒╃敤 <script> 鏍囩娌℃湁璺ㄥ煙闄愬埗鐨勬紡娲烇紝缃戦〉鍙互寰楀埌浠庡叾浠栨潵婧愬姩鎬佷骇鐢熺殑 JSON 鏁版嵁,涓嶅畨鍏ㄥ彲鑳戒細閬彈XSS鏀诲嚮銆?/p>

JSONP 浣跨敤绠€鍗曚笖鍏煎鎬т笉閿欙紝浣嗘槸鍙檺浜?get 璇锋眰銆?/p>

<script ></script><script> function jsonp(data) { console.log(data) }</script>

浠庤緭鍏RL鍒伴〉闈㈠睍绀猴紝杩欎腑闂村彂鐢熶簡浠€涔堬紵

浠庤緭鍏?URL 鍒伴〉闈㈠睍绀哄畬鏁存祦绋嬬ず鎰忓浘

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=

杈撳叆url骞跺洖杞︼紝娴忚鍣ㄨ繘绋嬫鏌rl锛岀粍瑁呭崗璁紝鏋勬垚瀹屾暣鐨剈rl锛岄€氳繃杩涚▼闂撮€氫俊锛圛PC锛夋妸url璇锋眰鍙戦€佺粰缃戠粶杩涚▼锛屾帴鏀跺埌url璇锋眰鍚庢鏌ユ湰鍦扮紦瀛樻槸鍚︾紦瀛樿璇锋眰璧勬簮锛屽鏋滄湁,鍒欏皢璇ヨ祫婧愯繑鍥炵粰娴忚鍣ㄨ繘绋嬶紝濡傛灉娌℃湁锛岀綉缁滆繘绋嬪悜web鏈嶅姟鍣ㄥ彂璧穐ttp璇锋眰銆?/p>

鍚憌eb鏈嶅姟鍣ㄥ彂璧穐ttp璇锋眰

  1. 杩涜DNS瑙f瀽锛岃幏鍙栨湇鍔″櫒ip鍦板潃锛岀鍙?
  2. 鍒╃敤ip鍦板潃鍜屾湇鍔″櫒寤虹珛tcp杩炴帴
  3. 鏋勫缓璇锋眰澶翠俊鎭?
  4. 鍙戦€佽姹傚ご淇℃伅
  5. 鏈嶅姟鍣ㄥ搷搴斿悗锛岀綉缁滆繘绋嬫帴鏀跺搷搴斿ご鍜屽搷搴斾俊鎭紝骞惰В鏋愬搷搴斿唴瀹?
  6. 缃戠粶杩涚▼瑙f瀽鍝嶅簲娴佺▼
  7. 鍑嗗娓叉煋杩涚▼
  8. 浼犺緭鏁版嵁銆佹洿鏂扮姸鎬?

Web鏈嶅姟鍣?/h4>
  1. 鐢ㄥ崟鍙拌櫄鎷熶富鏈哄疄鐜板涓煙鍚?
  2. HTTP/1.1 瑙勮寖鍏佽涓€鍙?HTTP 鏈嶅姟鍣ㄦ惌寤哄涓?Web 绔欑偣

浠g悊銆佺綉鍏炽€侀毀 閬?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=鏉ユ簮浜庛€婂浘瑙TTP銆?/p>

浠g悊锛?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=鏉ユ簮浜庛€婂浘瑙TTP銆?/p>

缃戝叧锛?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=鏉ユ簮浜庛€婂浘瑙TTP銆?/p>

闅ч亾锛?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=鏉ユ簮浜庛€婂浘瑙TTP銆?/p>

缂撳瓨锛?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=鏉ユ簮浜庛€婂浘瑙TTP銆?/p>

鏈夋晥鏈熼檺锛?/p>

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=鏉ユ簮浜庛€婂浘瑙TTP銆?/p>

web瀹夊叏

12鏈熷墠绔啿鍒哄繀澶囨寚鍗?HTTP/HTTPS/HTTP2/DNS/TCP/缁忓吀棰? class=
  1. 閫氫俊浣跨敤鏄庢枃鍙兘浼氳绐冨惉锛屽瓨鍦ㄩ€氫俊鍐呭琚獌鍚殑椋庨櫓
  2. TCP/IP 鍙兘琚獌鍚殑缃戠粶
  3. 鍔犲瘑澶勭悊闃叉琚獌鍚?
  4. 鏃犳硶璇佹槑鎶ユ枃瀹屾暣鎬э紝鍙兘宸查伃绡℃敼
  5. 浣跨敤 HTTPS 閫氫俊
  6. HTTP+ 鍔犲瘑 + 璁よ瘉 + 瀹屾暣鎬т繚鎶?=HTTPS

鍙傝€冩枃鐚?/span>

浣犵寽涓€涓?TCP 杩炴帴涓婇潰鑳藉彂澶氬皯涓?HTTP 璇锋眰

鍓嶇鎬荤粨--缃戠粶

銆婂浘瑙TTP銆?/p>


以上是关于的主要内容,如果未能解决你的问题,请参考以下文章

谷歌浏览器调试jsp 引入代码片段,如何调试代码片段中的js

片段和活动之间的核心区别是啥?哪些代码可以写成片段?

VSCode自定义代码片段——.vue文件的模板

VSCode自定义代码片段6——CSS选择器

VSCode自定义代码片段——声明函数

VSCode自定义代码片段8——声明函数