{"id":87795,"date":"2026-07-30T22:08:32","date_gmt":"2026-07-30T14:08:32","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/87795.html"},"modified":"2026-07-30T22:08:32","modified_gmt":"2026-07-30T14:08:32","slug":"http-%e5%92%8c-https-%e8%af%a6%e8%a7%a3%ef%bc%9a%e5%b7%a5%e4%bd%9c%e5%8e%9f%e7%90%86%e3%80%81%e9%80%9a%e4%bf%a1%e6%b5%81%e7%a8%8b%e3%80%81%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e5%8f%8a%e6%a0%b8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/87795.html","title":{"rendered":"HTTP \u548c HTTPS \u8be6\u89e3\uff1a\u5de5\u4f5c\u539f\u7406\u3001\u901a\u4fe1\u6d41\u7a0b\u3001\u4f7f\u7528\u65b9\u6cd5\u53ca\u6838\u5fc3\u533a\u522b"},"content":{"rendered":"<h2>HTTP \u548c HTTPS \u8be6\u89e3&#xff1a;\u5de5\u4f5c\u539f\u7406\u3001\u901a\u4fe1\u6d41\u7a0b\u3001\u4f7f\u7528\u65b9\u6cd5\u53ca\u6838\u5fc3\u533a\u522b<\/h2>\n<h3>\u524d\u8a00<\/h3>\n<p>\u5728\u6d4f\u89c8\u5668\u5730\u5740\u680f\u4e2d\u8f93\u5165\u4e00\u4e2a\u7f51\u5740\u65f6&#xff0c;\u901a\u5e38\u4f1a\u770b\u5230\u4e0b\u9762\u4e24\u79cd\u5f62\u5f0f&#xff1a;<\/p>\n<p>http:\/\/www.example.com<br \/>\nhttps:\/\/www.example.com<\/p>\n<p>\u5176\u4e2d&#xff1a;<\/p>\n<ul>\n<li>HTTP \u662f\u8d85\u6587\u672c\u4f20\u8f93\u534f\u8bae&#xff1b;<\/li>\n<li>HTTPS \u662f\u4f7f\u7528 TLS \u52a0\u5bc6\u4fdd\u62a4\u7684 HTTP&#xff1b;<\/li>\n<li>HTTP \u9ed8\u8ba4\u4f7f\u7528 80 \u7aef\u53e3&#xff1b;<\/li>\n<li>HTTPS \u9ed8\u8ba4\u4f7f\u7528 443 \u7aef\u53e3\u3002<\/li>\n<\/ul>\n<p>HTTP \u548c HTTPS \u662f Web \u5f00\u53d1\u3001\u524d\u540e\u7aef\u901a\u4fe1\u3001\u63a5\u53e3\u8c03\u7528\u3001\u7269\u8054\u7f51\u8bbe\u5907\u8054\u7f51\u4ee5\u53ca\u79fb\u52a8\u7aef\u5f00\u53d1\u4e2d\u6700\u5e38\u89c1\u7684\u7f51\u7edc\u534f\u8bae\u3002<\/p>\n<p>\u5f88\u591a\u521d\u5b66\u8005\u77e5\u9053\u201cHTTPS \u6bd4 HTTP \u5b89\u5168\u201d&#xff0c;\u4f46\u5e76\u4e0d\u6e05\u695a\u4ee5\u4e0b\u95ee\u9898&#xff1a;<\/p>\n<ul>\n<li>HTTP \u5230\u5e95\u8d1f\u8d23\u4ec0\u4e48&#xff1f;<\/li>\n<li>\u6d4f\u89c8\u5668\u662f\u5982\u4f55\u5411\u670d\u52a1\u5668\u53d1\u9001\u8bf7\u6c42\u7684&#xff1f;<\/li>\n<li>GET \u548c POST \u6709\u4ec0\u4e48\u533a\u522b&#xff1f;<\/li>\n<li>HTTPS \u662f\u600e\u6837\u5b9e\u73b0\u52a0\u5bc6\u7684&#xff1f;<\/li>\n<li>\u4e3a\u4ec0\u4e48\u6709\u4e86 HTTPS&#xff0c;\u522b\u4eba\u5c31\u4e0d\u80fd\u76f4\u63a5\u770b\u5230\u5bc6\u7801&#xff1f;<\/li>\n<li>HTTP\/1.1\u3001HTTP\/2 \u548c HTTP\/3 \u53c8\u6709\u4ec0\u4e48\u5173\u7cfb&#xff1f;<\/li>\n<\/ul>\n<p>\u672c\u6587\u5c06\u4ece\u57fa\u7840\u6982\u5ff5\u5f00\u59cb&#xff0c;\u7cfb\u7edf\u8bb2\u89e3 HTTP \u548c HTTPS\u3002<\/p>\n<hr \/>\n<h2>\u4e00\u3001HTTP \u662f\u4ec0\u4e48<\/h2>\n<p>HTTP \u7684\u82f1\u6587\u5168\u79f0\u662f&#xff1a;<\/p>\n<p>HyperText Transfer Protocol<\/p>\n<p>\u4e2d\u6587\u540d\u79f0\u662f&#xff1a;<\/p>\n<p>\u8d85\u6587\u672c\u4f20\u8f93\u534f\u8bae<\/p>\n<p>HTTP \u662f\u4e00\u79cd\u5e94\u7528\u5c42\u534f\u8bae&#xff0c;\u4e3b\u8981\u7528\u4e8e\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u4f20\u8f93\u6570\u636e\u3002<\/p>\n<p>\u8fd9\u91cc\u7684\u5ba2\u6237\u7aef\u53ef\u4ee5\u662f&#xff1a;<\/p>\n<ul>\n<li>\u6d4f\u89c8\u5668&#xff1b;<\/li>\n<li>\u624b\u673a App&#xff1b;<\/li>\n<li>\u5c0f\u7a0b\u5e8f&#xff1b;<\/li>\n<li>\u5d4c\u5165\u5f0f\u8bbe\u5907&#xff1b;<\/li>\n<li>Python \u7a0b\u5e8f&#xff1b;<\/li>\n<li>Java \u7a0b\u5e8f&#xff1b;<\/li>\n<li>Postman&#xff1b;<\/li>\n<li>curl&#xff1b;<\/li>\n<li>\u5176\u4ed6\u7f51\u7edc\u5e94\u7528\u3002<\/li>\n<\/ul>\n<p>\u670d\u52a1\u5668\u5219\u901a\u5e38\u662f&#xff1a;<\/p>\n<ul>\n<li>Nginx&#xff1b;<\/li>\n<li>Apache&#xff1b;<\/li>\n<li>Tomcat&#xff1b;<\/li>\n<li>Node.js&#xff1b;<\/li>\n<li>Spring Boot&#xff1b;<\/li>\n<li>Django&#xff1b;<\/li>\n<li>Flask&#xff1b;<\/li>\n<li>FastAPI&#xff1b;<\/li>\n<li>\u4e91\u670d\u52a1\u5668\u4e0a\u7684 Web \u670d\u52a1\u3002<\/li>\n<\/ul>\n<p>HTTP \u6700\u521d\u4e3b\u8981\u7528\u4e8e\u4f20\u8f93 HTML \u7f51\u9875&#xff0c;\u4f46\u73b0\u5728\u5df2\u7ecf\u53ef\u4ee5\u4f20\u8f93\u591a\u79cd\u6570\u636e&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<ul>\n<li>HTML \u9875\u9762&#xff1b;<\/li>\n<li>CSS \u6587\u4ef6&#xff1b;<\/li>\n<li>JavaScript \u6587\u4ef6&#xff1b;<\/li>\n<li>JSON \u6570\u636e&#xff1b;<\/li>\n<li>XML \u6570\u636e&#xff1b;<\/li>\n<li>\u56fe\u7247&#xff1b;<\/li>\n<li>\u97f3\u9891&#xff1b;<\/li>\n<li>\u89c6\u9891&#xff1b;<\/li>\n<li>\u538b\u7f29\u5305&#xff1b;<\/li>\n<li>\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<p>\u56e0\u6b64&#xff0c;HTTP \u5e76\u4e0d\u53ea\u662f\u201c\u4f20\u8f93\u7f51\u9875\u201d&#xff0c;\u5b83\u5b9e\u9645\u4e0a\u662f\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u975e\u5e38\u901a\u7528\u7684\u6570\u636e\u901a\u4fe1\u534f\u8bae\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u3001HTTP \u4f4d\u4e8e\u7f51\u7edc\u6a21\u578b\u7684\u54ea\u4e00\u5c42<\/h2>\n<p>HTTP \u5c5e\u4e8e\u5e94\u7528\u5c42\u534f\u8bae\u3002<\/p>\n<p>\u4e00\u4e2a\u5178\u578b\u7684 HTTP \u7f51\u7edc\u901a\u4fe1\u8fc7\u7a0b\u53ef\u4ee5\u7b80\u5316\u4e3a&#xff1a;<\/p>\n<p>\u5e94\u7528\u5c42&#xff1a;HTTP<br \/>\n\u4f20\u8f93\u5c42&#xff1a;TCP<br \/>\n\u7f51\u7edc\u5c42&#xff1a;IP<br \/>\n\u6570\u636e\u94fe\u8def\u5c42&#xff1a;\u4ee5\u592a\u7f51\u6216 Wi-Fi<br \/>\n\u7269\u7406\u5c42&#xff1a;\u7f51\u7ebf\u3001\u5149\u7ea4\u3001\u65e0\u7ebf\u4fe1\u53f7<\/p>\n<p>\u4f20\u7edf HTTP \u901a\u5e38\u5de5\u4f5c\u5728 TCP \u4e4b\u4e0a&#xff1a;<\/p>\n<p>HTTP<br \/>\n  \u2193<br \/>\nTCP<br \/>\n  \u2193<br \/>\nIP<br \/>\n  \u2193<br \/>\n\u4ee5\u592a\u7f51\u6216 Wi-Fi<\/p>\n<p>HTTPS \u5219\u662f\u5728 HTTP \u548c TCP \u4e4b\u95f4\u52a0\u5165 TLS&#xff1a;<\/p>\n<p>HTTP<br \/>\n  \u2193<br \/>\nTLS<br \/>\n  \u2193<br \/>\nTCP<br \/>\n  \u2193<br \/>\nIP<br \/>\n  \u2193<br \/>\n\u4ee5\u592a\u7f51\u6216 Wi-Fi<\/p>\n<p>\u9700\u8981\u6ce8\u610f&#xff0c;HTTP\/3 \u7684\u5e95\u5c42\u4e0d\u518d\u76f4\u63a5\u4f7f\u7528 TCP&#xff0c;\u800c\u662f\u4f7f\u7528\u57fa\u4e8e UDP \u7684 QUIC \u534f\u8bae&#xff1a;<\/p>\n<p>HTTP\/3<br \/>\n  \u2193<br \/>\nQUIC<br \/>\n  \u2193<br \/>\nUDP<br \/>\n  \u2193<br \/>\nIP<\/p>\n<hr \/>\n<h2>\u4e09\u3001HTTP \u7684\u57fa\u672c\u901a\u4fe1\u6a21\u578b<\/h2>\n<p>HTTP \u91c7\u7528\u8bf7\u6c42\u548c\u54cd\u5e94\u6a21\u578b\u3002<\/p>\n<p>\u5ba2\u6237\u7aef\u4e3b\u52a8\u53d1\u9001\u8bf7\u6c42&#xff0c;\u670d\u52a1\u5668\u63a5\u6536\u5230\u8bf7\u6c42\u540e\u8fd4\u56de\u54cd\u5e94\u3002<\/p>\n<p>\u57fa\u672c\u8fc7\u7a0b\u5982\u4e0b&#xff1a;<\/p>\n<p>\u5ba2\u6237\u7aef                         \u670d\u52a1\u5668<\/p>\n<p>   &#8212;&#8212;&#8211; HTTP \u8bf7\u6c42 &#8212;&#8212;&#8211;&gt;<\/p>\n<p>   &lt;&#8212;&#8212;- HTTP \u54cd\u5e94 &#8212;&#8212;&#8211;<\/p>\n<p>\u4f8b\u5982&#xff0c;\u7528\u6237\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee&#xff1a;<\/p>\n<p>http:\/\/www.example.com\/index.html<\/p>\n<p>\u6d4f\u89c8\u5668\u4f1a\u5411\u670d\u52a1\u5668\u53d1\u9001\u8bf7\u6c42&#xff1a;<\/p>\n<p>GET \/index.html HTTP\/1.1<br \/>\nHost: www.example.com<\/p>\n<p>\u670d\u52a1\u5668\u5904\u7406\u540e\u8fd4\u56de\u54cd\u5e94&#xff1a;<\/p>\n<p>HTTP\/1.1 200 OK<br \/>\nContent-Type: text\/html<br \/>\nContent-Length: 1256<\/p>\n<p>&lt;html&gt;<br \/>\n    &lt;body&gt;<br \/>\n        &lt;h1&gt;Hello HTTP&lt;\/h1&gt;<br \/>\n    &lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<p>\u6d4f\u89c8\u5668\u6536\u5230 HTML \u540e&#xff0c;\u5bf9\u5185\u5bb9\u8fdb\u884c\u89e3\u6790\u548c\u6e32\u67d3&#xff0c;\u6700\u7ec8\u663e\u793a\u51fa\u7f51\u9875\u3002<\/p>\n<hr \/>\n<h2>\u56db\u3001\u8bbf\u95ee\u4e00\u4e2a HTTP \u7f51\u7ad9\u65f6\u53d1\u751f\u4e86\u4ec0\u4e48<\/h2>\n<p>\u5f53\u7528\u6237\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165&#xff1a;<\/p>\n<p>http:\/\/www.example.com<\/p>\n<p>\u6d4f\u89c8\u5668\u901a\u5e38\u4f1a\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\u3002<\/p>\n<h3>1. \u89e3\u6790 URL<\/h3>\n<p>URL \u53ef\u4ee5\u62c6\u5206\u4e3a&#xff1a;<\/p>\n<p>http:\/\/www.example.com:80\/index.html?name&#061;zhangsan<\/p>\n<p>\u5404\u90e8\u5206\u542b\u4e49\u5982\u4e0b&#xff1a;<\/p>\n<p>http                 \u534f\u8bae<br \/>\nwww.example.com      \u57df\u540d<br \/>\n80                   \u7aef\u53e3<br \/>\n\/index.html          \u8d44\u6e90\u8def\u5f84<br \/>\nname&#061;zhangsan        \u67e5\u8be2\u53c2\u6570<\/p>\n<p>\u5982\u679c\u6ca1\u6709\u660e\u786e\u5199\u51fa\u7aef\u53e3&#xff0c;HTTP \u9ed8\u8ba4\u4f7f\u7528 80 \u7aef\u53e3\u3002<\/p>\n<hr \/>\n<h3>2. DNS \u57df\u540d\u89e3\u6790<\/h3>\n<p>\u8ba1\u7b97\u673a\u901a\u4fe1\u6700\u7ec8\u4f7f\u7528\u7684\u662f IP \u5730\u5740&#xff0c;\u800c\u4e0d\u662f\u57df\u540d\u3002<\/p>\n<p>\u6d4f\u89c8\u5668\u9700\u8981\u5c06&#xff1a;<\/p>\n<p>www.example.com<\/p>\n<p>\u89e3\u6790\u4e3a\u7c7b\u4f3c\u4e0b\u9762\u7684 IP \u5730\u5740&#xff1a;<\/p>\n<p>192.0.2.10<\/p>\n<p>\u8fd9\u4e2a\u8fc7\u7a0b\u7531 DNS \u5b8c\u6210\u3002<\/p>\n<p>\u53ef\u4ee5\u7b80\u5355\u7406\u89e3\u4e3a&#xff1a;<\/p>\n<p>\u57df\u540d&#xff1a;www.example.com<br \/>\n             \u2193 DNS<br \/>\nIP\u5730\u5740&#xff1a;192.0.2.10<\/p>\n<hr \/>\n<h3>3. \u5efa\u7acb TCP \u8fde\u63a5<\/h3>\n<p>\u83b7\u5f97\u670d\u52a1\u5668 IP \u5730\u5740\u540e&#xff0c;\u5ba2\u6237\u7aef\u9700\u8981\u4e0e\u670d\u52a1\u5668\u5efa\u7acb TCP \u8fde\u63a5\u3002<\/p>\n<p>TCP \u5efa\u7acb\u8fde\u63a5\u9700\u8981\u8fdb\u884c\u4e09\u6b21\u63e1\u624b&#xff1a;<\/p>\n<p>\u5ba2\u6237\u7aef                         \u670d\u52a1\u5668<\/p>\n<p>   &#8212;&#8212;&#8211; SYN &#8212;&#8212;&#8212;&#8212;-&gt;<\/p>\n<p>   &lt;&#8212;&#8211; SYN &#043; ACK &#8212;&#8212;&#8212;-<\/p>\n<p>   &#8212;&#8212;&#8211; ACK &#8212;&#8212;&#8212;&#8212;-&gt;<\/p>\n<p>\u4e09\u6b21\u63e1\u624b\u5b8c\u6210\u540e&#xff0c;\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u5efa\u7acb\u53ef\u9760\u7684 TCP \u8fde\u63a5\u3002<\/p>\n<hr \/>\n<h3>4. \u53d1\u9001 HTTP \u8bf7\u6c42<\/h3>\n<p>TCP \u8fde\u63a5\u5efa\u7acb\u540e&#xff0c;\u6d4f\u89c8\u5668\u5411\u670d\u52a1\u5668\u53d1\u9001 HTTP \u8bf7\u6c42\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>GET \/index.html HTTP\/1.1<br \/>\nHost: www.example.com<br \/>\nUser-Agent: Mozilla\/5.0<br \/>\nAccept: text\/html<br \/>\nConnection: keep-alive<\/p>\n<hr \/>\n<h3>5. \u670d\u52a1\u5668\u5904\u7406\u8bf7\u6c42<\/h3>\n<p>\u670d\u52a1\u5668\u63a5\u6536\u5230\u8bf7\u6c42\u540e&#xff0c;\u4f1a\u6839\u636e\u8bf7\u6c42\u8def\u5f84\u8fdb\u884c\u5904\u7406\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\/index.html<br \/>\n\/api\/user<br \/>\n\/api\/login<br \/>\n\/images\/logo.png<\/p>\n<p>\u670d\u52a1\u5668\u53ef\u80fd\u4f1a&#xff1a;<\/p>\n<ul>\n<li>\u76f4\u63a5\u8fd4\u56de\u9759\u6001\u6587\u4ef6&#xff1b;<\/li>\n<li>\u67e5\u8be2\u6570\u636e\u5e93&#xff1b;<\/li>\n<li>\u8c03\u7528\u4e1a\u52a1\u4ee3\u7801&#xff1b;<\/li>\n<li>\u68c0\u67e5\u7528\u6237\u8eab\u4efd&#xff1b;<\/li>\n<li>\u8c03\u7528\u5176\u4ed6\u670d\u52a1&#xff1b;<\/li>\n<li>\u751f\u6210 JSON \u6570\u636e&#xff1b;<\/li>\n<li>\u8fd4\u56de\u9519\u8bef\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>6. \u8fd4\u56de HTTP \u54cd\u5e94<\/h3>\n<p>\u670d\u52a1\u5668\u5b8c\u6210\u5904\u7406\u540e&#xff0c;\u5c06\u7ed3\u679c\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef&#xff1a;<\/p>\n<p>HTTP\/1.1 200 OK<br \/>\nContent-Type: text\/html; charset&#061;utf-8<br \/>\nContent-Length: 1024<\/p>\n<p>&lt;html&gt;<br \/>\n    &lt;body&gt;<br \/>\n        &lt;h1&gt;Hello World&lt;\/h1&gt;<br \/>\n    &lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<hr \/>\n<h3>7. \u6d4f\u89c8\u5668\u89e3\u6790\u548c\u6e32\u67d3<\/h3>\n<p>\u6d4f\u89c8\u5668\u6536\u5230 HTML \u540e&#xff0c;\u4f1a\u89e3\u6790\u9875\u9762\u3002<\/p>\n<p>\u5982\u679c HTML \u4e2d\u8fd8\u5f15\u7528\u4e86\u5176\u4ed6\u8d44\u6e90&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>link<\/span> <span class=\"token attr-name\">rel<\/span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">&#061;<\/span><span class=\"token punctuation\">&#034;<\/span>stylesheet<span class=\"token punctuation\">&#034;<\/span><\/span> <span class=\"token attr-name\">href<\/span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">&#061;<\/span><span class=\"token punctuation\">&#034;<\/span>\/css\/style.css<span class=\"token punctuation\">&#034;<\/span><\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>script<\/span> <span class=\"token attr-name\">src<\/span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">&#061;<\/span><span class=\"token punctuation\">&#034;<\/span>\/js\/app.js<span class=\"token punctuation\">&#034;<\/span><\/span><span class=\"token punctuation\">&gt;<\/span><\/span><span class=\"token script\"><\/span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>script<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>img<\/span> <span class=\"token attr-name\">src<\/span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">&#061;<\/span><span class=\"token punctuation\">&#034;<\/span>\/images\/logo.png<span class=\"token punctuation\">&#034;<\/span><\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<p>\u6d4f\u89c8\u5668\u8fd8\u4f1a\u7ee7\u7eed\u8bf7\u6c42&#xff1a;<\/p>\n<p>\/css\/style.css<br \/>\n\/js\/app.js<br \/>\n\/images\/logo.png<\/p>\n<p>\u56e0\u6b64&#xff0c;\u6253\u5f00\u4e00\u4e2a\u7f51\u9875\u901a\u5e38\u4e0d\u53ea\u662f\u53d1\u9001\u4e00\u6b21 HTTP \u8bf7\u6c42&#xff0c;\u800c\u662f\u53ef\u80fd\u53d1\u9001\u51e0\u5341\u6b21\u751a\u81f3\u51e0\u767e\u6b21\u8bf7\u6c42\u3002<\/p>\n<hr \/>\n<h2>\u4e94\u3001HTTP \u8bf7\u6c42\u62a5\u6587\u7ed3\u6784<\/h2>\n<p>HTTP \u8bf7\u6c42\u901a\u5e38\u7531\u56db\u90e8\u5206\u7ec4\u6210&#xff1a;<\/p>\n<p>\u8bf7\u6c42\u884c<br \/>\n\u8bf7\u6c42\u5934<br \/>\n\u7a7a\u884c<br \/>\n\u8bf7\u6c42\u4f53<\/p>\n<p>\u5b8c\u6574\u793a\u4f8b\u5982\u4e0b&#xff1a;<\/p>\n<p>POST \/api\/login HTTP\/1.1<br \/>\nHost: www.example.com<br \/>\nContent-Type: application\/json<br \/>\nContent-Length: 48<br \/>\nUser-Agent: Mozilla\/5.0<\/p>\n<p>{<br \/>\n    &#034;username&#034;: &#034;admin&#034;,<br \/>\n    &#034;password&#034;: &#034;123456&#034;<br \/>\n}<\/p>\n<hr \/>\n<h3>1. \u8bf7\u6c42\u884c<\/h3>\n<p>\u8bf7\u6c42\u884c\u683c\u5f0f\u4e3a&#xff1a;<\/p>\n<p>\u8bf7\u6c42\u65b9\u6cd5 \u8bf7\u6c42\u8def\u5f84 HTTP\u7248\u672c<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>GET \/api\/user HTTP\/1.1<\/p>\n<p>\u5176\u4e2d&#xff1a;<\/p>\n<ul>\n<li>GET&#xff1a;\u8bf7\u6c42\u65b9\u6cd5&#xff1b;<\/li>\n<li>\/api\/user&#xff1a;\u8bf7\u6c42\u8d44\u6e90\u8def\u5f84&#xff1b;<\/li>\n<li>HTTP\/1.1&#xff1a;HTTP \u534f\u8bae\u7248\u672c\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>2. \u8bf7\u6c42\u5934<\/h3>\n<p>\u8bf7\u6c42\u5934\u7528\u4e8e\u643a\u5e26\u9644\u52a0\u4fe1\u606f\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>Host: www.example.com<br \/>\nContent-Type: application\/json<br \/>\nAuthorization: Bearer xxxxxx<br \/>\nUser-Agent: Mozilla\/5.0<br \/>\nAccept: application\/json<br \/>\nCookie: session_id&#061;123456<\/p>\n<p>\u5e38\u89c1\u8bf7\u6c42\u5934\u5982\u4e0b\u3002<\/p>\n<h4>Host<\/h4>\n<p>\u8868\u793a\u76ee\u6807\u670d\u52a1\u5668\u7684\u57df\u540d&#xff1a;<\/p>\n<p>Host: www.example.com<\/p>\n<p>\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u53ef\u80fd\u90e8\u7f72\u591a\u4e2a\u7f51\u7ad9&#xff0c;\u670d\u52a1\u5668\u53ef\u4ee5\u6839\u636e Host \u5224\u65ad\u5ba2\u6237\u7aef\u8bbf\u95ee\u7684\u662f\u54ea\u4e2a\u7f51\u7ad9\u3002<\/p>\n<h4>Content-Type<\/h4>\n<p>\u8868\u793a\u8bf7\u6c42\u4f53\u7684\u6570\u636e\u683c\u5f0f&#xff1a;<\/p>\n<p>Content-Type: application\/json<\/p>\n<p>\u5e38\u89c1\u7c7b\u578b\u5305\u62ec&#xff1a;<\/p>\n<p>application\/json<br \/>\napplication\/x-www-form-urlencoded<br \/>\nmultipart\/form-data<br \/>\ntext\/plain<br \/>\ntext\/html<\/p>\n<h4>Authorization<\/h4>\n<p>\u7528\u4e8e\u643a\u5e26\u8eab\u4efd\u8ba4\u8bc1\u4fe1\u606f&#xff1a;<\/p>\n<p>Authorization: Bearer eyJhbGciOi&#8230;<\/p>\n<h4>User-Agent<\/h4>\n<p>\u8868\u793a\u5ba2\u6237\u7aef\u7c7b\u578b\u3001\u6d4f\u89c8\u5668\u548c\u64cd\u4f5c\u7cfb\u7edf\u4fe1\u606f&#xff1a;<\/p>\n<p>User-Agent: Mozilla\/5.0<\/p>\n<h4>Accept<\/h4>\n<p>\u8868\u793a\u5ba2\u6237\u7aef\u5e0c\u671b\u63a5\u6536\u7684\u6570\u636e\u7c7b\u578b&#xff1a;<\/p>\n<p>Accept: application\/json<\/p>\n<h4>Cookie<\/h4>\n<p>\u7528\u4e8e\u5411\u670d\u52a1\u5668\u53d1\u9001 Cookie&#xff1a;<\/p>\n<p>Cookie: session_id&#061;abc123<\/p>\n<hr \/>\n<h3>3. \u7a7a\u884c<\/h3>\n<p>\u8bf7\u6c42\u5934\u548c\u8bf7\u6c42\u4f53\u4e4b\u95f4\u5fc5\u987b\u5b58\u5728\u4e00\u4e2a\u7a7a\u884c\u3002<\/p>\n<p>\u8fd9\u4e2a\u7a7a\u884c\u7528\u4e8e\u544a\u8bc9\u670d\u52a1\u5668&#xff1a;<\/p>\n<p>\u8bf7\u6c42\u5934\u5df2\u7ecf\u7ed3\u675f&#xff0c;\u540e\u9762\u662f\u8bf7\u6c42\u4f53\u3002<\/p>\n<hr \/>\n<h3>4. \u8bf7\u6c42\u4f53<\/h3>\n<p>\u8bf7\u6c42\u4f53\u7528\u4e8e\u643a\u5e26\u63d0\u4ea4\u7ed9\u670d\u52a1\u5668\u7684\u6570\u636e\u3002<\/p>\n<p>\u4f8b\u5982\u767b\u5f55\u8bf7\u6c42&#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token string-property property\">&#034;username&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;admin&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;password&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;123456&#034;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>GET \u8bf7\u6c42\u4e00\u822c\u4e0d\u4f7f\u7528\u8bf7\u6c42\u4f53&#xff0c;\u800c POST\u3001PUT\u3001PATCH \u7b49\u8bf7\u6c42\u7ecf\u5e38\u643a\u5e26\u8bf7\u6c42\u4f53\u3002<\/p>\n<hr \/>\n<h2>\u516d\u3001HTTP \u54cd\u5e94\u62a5\u6587\u7ed3\u6784<\/h2>\n<p>HTTP \u54cd\u5e94\u901a\u5e38\u7531\u56db\u90e8\u5206\u7ec4\u6210&#xff1a;<\/p>\n<p>\u72b6\u6001\u884c<br \/>\n\u54cd\u5e94\u5934<br \/>\n\u7a7a\u884c<br \/>\n\u54cd\u5e94\u4f53<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>HTTP\/1.1 200 OK<br \/>\nContent-Type: application\/json<br \/>\nContent-Length: 55<br \/>\nServer: nginx<\/p>\n<p>{<br \/>\n    &#034;code&#034;: 200,<br \/>\n    &#034;message&#034;: &#034;success&#034;<br \/>\n}<\/p>\n<hr \/>\n<h3>1. \u72b6\u6001\u884c<\/h3>\n<p>\u72b6\u6001\u884c\u683c\u5f0f\u5982\u4e0b&#xff1a;<\/p>\n<p>HTTP\u7248\u672c \u72b6\u6001\u7801 \u72b6\u6001\u8bf4\u660e<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>HTTP\/1.1 200 OK<\/p>\n<p>\u5176\u4e2d&#xff1a;<\/p>\n<ul>\n<li>HTTP\/1.1&#xff1a;\u534f\u8bae\u7248\u672c&#xff1b;<\/li>\n<li>200&#xff1a;\u72b6\u6001\u7801&#xff1b;<\/li>\n<li>OK&#xff1a;\u72b6\u6001\u63cf\u8ff0\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>2. \u54cd\u5e94\u5934<\/h3>\n<p>\u54cd\u5e94\u5934\u7528\u4e8e\u63cf\u8ff0\u670d\u52a1\u5668\u8fd4\u56de\u7684\u6570\u636e\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>Content-Type: application\/json<br \/>\nContent-Length: 55<br \/>\nServer: nginx<br \/>\nSet-Cookie: session_id&#061;abc123<br \/>\nCache-Control: no-cache<\/p>\n<p>\u5e38\u89c1\u54cd\u5e94\u5934\u5305\u62ec&#xff1a;<\/p>\n<h4>Content-Type<\/h4>\n<p>\u8868\u793a\u54cd\u5e94\u4f53\u7684\u6570\u636e\u7c7b\u578b&#xff1a;<\/p>\n<p>Content-Type: application\/json<\/p>\n<h4>Content-Length<\/h4>\n<p>\u8868\u793a\u54cd\u5e94\u4f53\u957f\u5ea6&#xff1a;<\/p>\n<p>Content-Length: 1024<\/p>\n<h4>Set-Cookie<\/h4>\n<p>\u670d\u52a1\u5668\u901a\u8fc7\u8be5\u54cd\u5e94\u5934\u5411\u6d4f\u89c8\u5668\u8bbe\u7f6e Cookie&#xff1a;<\/p>\n<p>Set-Cookie: session_id&#061;abc123; HttpOnly; Secure<\/p>\n<h4>Cache-Control<\/h4>\n<p>\u7528\u4e8e\u63a7\u5236\u6d4f\u89c8\u5668\u7f13\u5b58&#xff1a;<\/p>\n<p>Cache-Control: max-age&#061;3600<\/p>\n<h4>Location<\/h4>\n<p>\u901a\u5e38\u7528\u4e8e\u91cd\u5b9a\u5411&#xff1a;<\/p>\n<p>Location: https:\/\/www.example.com\/login<\/p>\n<hr \/>\n<h3>3. \u54cd\u5e94\u4f53<\/h3>\n<p>\u54cd\u5e94\u4f53\u662f\u771f\u6b63\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u7684\u6570\u636e\u3002<\/p>\n<p>\u53ef\u80fd\u662f&#xff1a;<\/p>\n<ul>\n<li>HTML&#xff1b;<\/li>\n<li>JSON&#xff1b;<\/li>\n<li>XML&#xff1b;<\/li>\n<li>\u56fe\u7247&#xff1b;<\/li>\n<li>\u89c6\u9891&#xff1b;<\/li>\n<li>\u6587\u4ef6&#xff1b;<\/li>\n<li>\u4e8c\u8fdb\u5236\u6570\u636e\u3002<\/li>\n<\/ul>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token string-property property\">&#034;id&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token number\">1001<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;username&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;zhangsan&#034;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<hr \/>\n<h2>\u4e03\u3001HTTP \u5e38\u89c1\u8bf7\u6c42\u65b9\u6cd5<\/h2>\n<p>HTTP \u5b9a\u4e49\u4e86\u591a\u79cd\u8bf7\u6c42\u65b9\u6cd5\u3002<\/p>\n<h3>1. GET<\/h3>\n<p>GET \u7528\u4e8e\u83b7\u53d6\u8d44\u6e90\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>GET \/api\/users\/1001 HTTP\/1.1<\/p>\n<p>\u6d4f\u89c8\u5668\u8bbf\u95ee&#xff1a;<\/p>\n<p>https:\/\/www.example.com\/api\/users\/1001<\/p>\n<p>\u67e5\u8be2\u53c2\u6570\u901a\u5e38\u653e\u5728 URL \u4e2d&#xff1a;<\/p>\n<p>https:\/\/www.example.com\/search?keyword&#061;http&#038;page&#061;1<\/p>\n<p>GET \u7684\u7279\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u4e3b\u8981\u7528\u4e8e\u67e5\u8be2\u6570\u636e&#xff1b;<\/li>\n<li>\u53c2\u6570\u901a\u5e38\u4f4d\u4e8e URL \u4e2d&#xff1b;<\/li>\n<li>\u53ef\u4ee5\u88ab\u6d4f\u89c8\u5668\u7f13\u5b58&#xff1b;<\/li>\n<li>\u53ef\u4ee5\u4fdd\u5b58\u4e3a\u4e66\u7b7e&#xff1b;<\/li>\n<li>\u4e0d\u5e94\u8be5\u7528\u4e8e\u4fee\u6539\u91cd\u8981\u6570\u636e&#xff1b;<\/li>\n<li>URL \u957f\u5ea6\u53ef\u80fd\u53d7\u5230\u5ba2\u6237\u7aef\u6216\u670d\u52a1\u5668\u9650\u5236\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>2. POST<\/h3>\n<p>POST \u7528\u4e8e\u63d0\u4ea4\u6570\u636e\u6216\u521b\u5efa\u8d44\u6e90\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>POST \/api\/users HTTP\/1.1<br \/>\nContent-Type: application\/json<\/p>\n<p>{<br \/>\n    &#034;username&#034;: &#034;zhangsan&#034;,<br \/>\n    &#034;age&#034;: 20<br \/>\n}<\/p>\n<p>POST \u7684\u7279\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u6570\u636e\u901a\u5e38\u4f4d\u4e8e\u8bf7\u6c42\u4f53\u4e2d&#xff1b;<\/li>\n<li>\u9002\u5408\u63d0\u4ea4\u8868\u5355&#xff1b;<\/li>\n<li>\u9002\u5408\u4e0a\u4f20\u6587\u4ef6&#xff1b;<\/li>\n<li>\u5e38\u7528\u4e8e\u65b0\u589e\u6570\u636e&#xff1b;<\/li>\n<li>\u9ed8\u8ba4\u4e0d\u4f1a\u50cf\u666e\u901a GET \u8bf7\u6c42\u4e00\u6837\u76f4\u63a5\u88ab\u7f13\u5b58\u3002<\/li>\n<\/ul>\n<p>\u9700\u8981\u6ce8\u610f&#xff1a;POST \u5e76\u4e0d\u7b49\u4e8e\u5b89\u5168\u3002<\/p>\n<p>\u5728\u666e\u901a HTTP \u4e2d&#xff0c;POST \u8bf7\u6c42\u4f53\u4ecd\u7136\u53ef\u80fd\u88ab\u76d1\u542c\u8005\u76f4\u63a5\u770b\u5230\u3002\u662f\u5426\u52a0\u5bc6\u53d6\u51b3\u4e8e\u662f\u5426\u4f7f\u7528 HTTPS&#xff0c;\u800c\u4e0d\u662f\u53d6\u51b3\u4e8e GET \u6216 POST\u3002<\/p>\n<hr \/>\n<h3>3. PUT<\/h3>\n<p>PUT \u901a\u5e38\u7528\u4e8e\u6574\u4f53\u66f4\u65b0\u67d0\u4e2a\u8d44\u6e90\u3002<\/p>\n<p>PUT \/api\/users\/1001 HTTP\/1.1<br \/>\nContent-Type: application\/json<\/p>\n<p>{<br \/>\n    &#034;username&#034;: &#034;lisi&#034;,<br \/>\n    &#034;age&#034;: 25<br \/>\n}<\/p>\n<hr \/>\n<h3>4. PATCH<\/h3>\n<p>PATCH \u901a\u5e38\u7528\u4e8e\u5c40\u90e8\u66f4\u65b0\u8d44\u6e90\u3002<\/p>\n<p>PATCH \/api\/users\/1001 HTTP\/1.1<br \/>\nContent-Type: application\/json<\/p>\n<p>{<br \/>\n    &#034;age&#034;: 26<br \/>\n}<\/p>\n<hr \/>\n<h3>5. DELETE<\/h3>\n<p>DELETE \u7528\u4e8e\u5220\u9664\u8d44\u6e90\u3002<\/p>\n<p>DELETE \/api\/users\/1001 HTTP\/1.1<\/p>\n<hr \/>\n<h3>6. HEAD<\/h3>\n<p>HEAD \u4e0e GET \u7c7b\u4f3c&#xff0c;\u4f46\u670d\u52a1\u5668\u53ea\u8fd4\u56de\u54cd\u5e94\u5934&#xff0c;\u4e0d\u8fd4\u56de\u54cd\u5e94\u4f53\u3002<\/p>\n<p>HEAD \/download\/file.zip HTTP\/1.1<\/p>\n<p>HEAD \u53ef\u4ee5\u7528\u4e8e&#xff1a;<\/p>\n<ul>\n<li>\u68c0\u67e5\u6587\u4ef6\u662f\u5426\u5b58\u5728&#xff1b;<\/li>\n<li>\u83b7\u53d6\u6587\u4ef6\u5927\u5c0f&#xff1b;<\/li>\n<li>\u67e5\u770b\u8d44\u6e90\u662f\u5426\u66f4\u65b0&#xff1b;<\/li>\n<li>\u68c0\u67e5\u670d\u52a1\u5668\u72b6\u6001\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>7. OPTIONS<\/h3>\n<p>OPTIONS \u7528\u4e8e\u67e5\u8be2\u670d\u52a1\u5668\u652f\u6301\u7684\u8bf7\u6c42\u65b9\u6cd5&#xff0c;\u4e5f\u7ecf\u5e38\u51fa\u73b0\u5728\u6d4f\u89c8\u5668\u8de8\u57df\u8bf7\u6c42\u7684\u9884\u68c0\u8fc7\u7a0b\u4e2d\u3002<\/p>\n<p>OPTIONS \/api\/users HTTP\/1.1<\/p>\n<hr \/>\n<h2>\u516b\u3001\u5e38\u89c1 HTTP \u72b6\u6001\u7801<\/h2>\n<p>HTTP \u72b6\u6001\u7801\u7531\u4e09\u4f4d\u6570\u5b57\u7ec4\u6210\u3002<\/p>\n<p>\u53ef\u4ee5\u6309\u7167\u7b2c\u4e00\u4f4d\u6570\u5b57\u8fdb\u884c\u5206\u7c7b\u3002<\/p>\n<hr \/>\n<h3>1xx&#xff1a;\u4fe1\u606f\u54cd\u5e94<\/h3>\n<p>\u8868\u793a\u8bf7\u6c42\u5df2\u6536\u5230&#xff0c;\u670d\u52a1\u5668\u6b63\u5728\u7ee7\u7eed\u5904\u7406\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>100 Continue<\/p>\n<hr \/>\n<h3>2xx&#xff1a;\u8bf7\u6c42\u6210\u529f<\/h3>\n<h4>200 OK<\/h4>\n<p>\u8bf7\u6c42\u6210\u529f&#xff1a;<\/p>\n<p>HTTP\/1.1 200 OK<\/p>\n<h4>201 Created<\/h4>\n<p>\u8d44\u6e90\u521b\u5efa\u6210\u529f&#xff0c;\u5e38\u7528\u4e8e POST \u8bf7\u6c42&#xff1a;<\/p>\n<p>HTTP\/1.1 201 Created<\/p>\n<h4>204 No Content<\/h4>\n<p>\u8bf7\u6c42\u6210\u529f&#xff0c;\u4f46\u6ca1\u6709\u54cd\u5e94\u4f53&#xff1a;<\/p>\n<p>HTTP\/1.1 204 No Content<\/p>\n<hr \/>\n<h3>3xx&#xff1a;\u91cd\u5b9a\u5411<\/h3>\n<h4>301 Moved Permanently<\/h4>\n<p>\u6c38\u4e45\u91cd\u5b9a\u5411\u3002<\/p>\n<p>\u4f8b\u5982\u5c06&#xff1a;<\/p>\n<p>http:\/\/example.com<\/p>\n<p>\u6c38\u4e45\u8df3\u8f6c\u5230&#xff1a;<\/p>\n<p>https:\/\/example.com<\/p>\n<h4>302 Found<\/h4>\n<p>\u4e34\u65f6\u91cd\u5b9a\u5411\u3002<\/p>\n<h4>304 Not Modified<\/h4>\n<p>\u8d44\u6e90\u6ca1\u6709\u53d8\u5316&#xff0c;\u5ba2\u6237\u7aef\u53ef\u4ee5\u7ee7\u7eed\u4f7f\u7528\u7f13\u5b58\u3002<\/p>\n<hr \/>\n<h3>4xx&#xff1a;\u5ba2\u6237\u7aef\u9519\u8bef<\/h3>\n<h4>400 Bad Request<\/h4>\n<p>\u8bf7\u6c42\u683c\u5f0f\u9519\u8bef\u6216\u53c2\u6570\u9519\u8bef\u3002<\/p>\n<h4>401 Unauthorized<\/h4>\n<p>\u7528\u6237\u6ca1\u6709\u5b8c\u6210\u8eab\u4efd\u8ba4\u8bc1\u3002<\/p>\n<h4>403 Forbidden<\/h4>\n<p>\u670d\u52a1\u5668\u7406\u89e3\u8bf7\u6c42&#xff0c;\u4f46\u62d2\u7edd\u8bbf\u95ee\u3002<\/p>\n<p>401 \u548c 403 \u7684\u533a\u522b\u53ef\u4ee5\u7b80\u5355\u7406\u89e3\u4e3a&#xff1a;<\/p>\n<p>401&#xff1a;\u4f60\u8fd8\u6ca1\u6709\u8bc1\u660e\u81ea\u5df1\u662f\u8c01\u3002<br \/>\n403&#xff1a;\u670d\u52a1\u5668\u77e5\u9053\u4f60\u662f\u8c01&#xff0c;\u4f46\u4f60\u6ca1\u6709\u6743\u9650\u3002<\/p>\n<h4>404 Not Found<\/h4>\n<p>\u8bf7\u6c42\u7684\u8d44\u6e90\u4e0d\u5b58\u5728\u3002<\/p>\n<h4>405 Method Not Allowed<\/h4>\n<p>\u8bf7\u6c42\u65b9\u6cd5\u4e0d\u88ab\u5141\u8bb8\u3002<\/p>\n<p>\u4f8b\u5982\u63a5\u53e3\u53ea\u5141\u8bb8 POST&#xff0c;\u4f46\u5ba2\u6237\u7aef\u4f7f\u7528\u4e86 GET\u3002<\/p>\n<h4>408 Request Timeout<\/h4>\n<p>\u8bf7\u6c42\u8d85\u65f6\u3002<\/p>\n<h4>429 Too Many Requests<\/h4>\n<p>\u8bf7\u6c42\u8fc7\u4e8e\u9891\u7e41&#xff0c;\u670d\u52a1\u5668\u8fdb\u884c\u4e86\u9650\u6d41\u3002<\/p>\n<hr \/>\n<h3>5xx&#xff1a;\u670d\u52a1\u5668\u9519\u8bef<\/h3>\n<h4>500 Internal Server Error<\/h4>\n<p>\u670d\u52a1\u5668\u5185\u90e8\u53d1\u751f\u9519\u8bef\u3002<\/p>\n<h4>502 Bad Gateway<\/h4>\n<p>\u7f51\u5173\u6216\u4ee3\u7406\u670d\u52a1\u5668\u4ece\u4e0a\u6e38\u670d\u52a1\u5668\u83b7\u5f97\u4e86\u65e0\u6548\u54cd\u5e94\u3002<\/p>\n<h4>503 Service Unavailable<\/h4>\n<p>\u670d\u52a1\u6682\u65f6\u4e0d\u53ef\u7528&#xff0c;\u53ef\u80fd\u662f\u670d\u52a1\u5668\u8fc7\u8f7d\u3001\u7ef4\u62a4\u6216\u670d\u52a1\u672a\u542f\u52a8\u3002<\/p>\n<h4>504 Gateway Timeout<\/h4>\n<p>\u7f51\u5173\u7b49\u5f85\u4e0a\u6e38\u670d\u52a1\u5668\u54cd\u5e94\u8d85\u65f6\u3002<\/p>\n<hr \/>\n<h2>\u4e5d\u3001HTTP \u7684\u4e3b\u8981\u7279\u70b9<\/h2>\n<h3>1. \u8bf7\u6c42\u548c\u54cd\u5e94\u6a21\u5f0f<\/h3>\n<p>HTTP \u901a\u5e38\u7531\u5ba2\u6237\u7aef\u53d1\u8d77\u8bf7\u6c42&#xff0c;\u670d\u52a1\u5668\u8fd4\u56de\u54cd\u5e94\u3002<\/p>\n<p>\u5ba2\u6237\u7aef\u8bf7\u6c42 \u2192 \u670d\u52a1\u5668\u5904\u7406 \u2192 \u670d\u52a1\u5668\u54cd\u5e94<\/p>\n<hr \/>\n<h3>2. \u65e0\u72b6\u6001<\/h3>\n<p>HTTP \u672c\u8eab\u662f\u65e0\u72b6\u6001\u534f\u8bae\u3002<\/p>\n<p>\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u670d\u52a1\u5668\u9ed8\u8ba4\u4e0d\u4f1a\u81ea\u52a8\u8bb0\u4f4f\u524d\u4e00\u6b21\u8bf7\u6c42\u3002<\/p>\n<p>\u4f8b\u5982&#xff0c;\u7b2c\u4e00\u6b21\u8bf7\u6c42&#xff1a;<\/p>\n<p>\u7528\u6237\u767b\u5f55<\/p>\n<p>\u7b2c\u4e8c\u6b21\u8bf7\u6c42&#xff1a;<\/p>\n<p>\u67e5\u770b\u4e2a\u4eba\u4fe1\u606f<\/p>\n<p>\u5982\u679c\u6ca1\u6709\u989d\u5916\u673a\u5236&#xff0c;\u670d\u52a1\u5668\u4e0d\u77e5\u9053\u8fd9\u4e24\u4e2a\u8bf7\u6c42\u662f\u4e0d\u662f\u6765\u81ea\u540c\u4e00\u4e2a\u7528\u6237\u3002<\/p>\n<p>\u56e0\u6b64&#xff0c;\u5b9e\u9645\u5f00\u53d1\u4e2d\u901a\u5e38\u4f7f\u7528\u4ee5\u4e0b\u65b9\u5f0f\u4fdd\u6301\u767b\u5f55\u72b6\u6001&#xff1a;<\/p>\n<ul>\n<li>Cookie&#xff1b;<\/li>\n<li>Session&#xff1b;<\/li>\n<li>Token&#xff1b;<\/li>\n<li>JWT&#xff1b;<\/li>\n<li>OAuth 2.0\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>3. \u652f\u6301\u6301\u4e45\u8fde\u63a5<\/h3>\n<p>\u65e9\u671f HTTP \u901a\u5e38\u4e00\u4e2a\u8bf7\u6c42\u5efa\u7acb\u4e00\u6b21 TCP \u8fde\u63a5&#xff0c;\u8bf7\u6c42\u5b8c\u6210\u540e\u7acb\u5373\u5173\u95ed\u3002<\/p>\n<p>HTTP\/1.1 \u9ed8\u8ba4\u652f\u6301\u6301\u4e45\u8fde\u63a5&#xff1a;<\/p>\n<p>Connection: keep-alive<\/p>\n<p>\u8fd9\u6837\u53ef\u4ee5\u5728\u540c\u4e00\u4e2a TCP \u8fde\u63a5\u4e2d\u53d1\u9001\u591a\u4e2a HTTP \u8bf7\u6c42&#xff0c;\u51cf\u5c11\u91cd\u590d\u5efa\u7acb\u8fde\u63a5\u7684\u5f00\u9500\u3002<\/p>\n<hr \/>\n<h3>4. \u7075\u6d3b\u7684\u6570\u636e\u683c\u5f0f<\/h3>\n<p>HTTP \u53ef\u4ee5\u4f20\u8f93&#xff1a;<\/p>\n<p>HTML<br \/>\nJSON<br \/>\nXML<br \/>\n\u6587\u672c<br \/>\n\u56fe\u7247<br \/>\n\u97f3\u9891<br \/>\n\u89c6\u9891<br \/>\n\u6587\u4ef6<br \/>\n\u4e8c\u8fdb\u5236\u6570\u636e<\/p>\n<p>\u6570\u636e\u683c\u5f0f\u901a\u5e38\u7531 Content-Type \u6307\u5b9a\u3002<\/p>\n<hr \/>\n<h3>5. HTTP \u672c\u8eab\u4e0d\u63d0\u4f9b\u52a0\u5bc6<\/h3>\n<p>\u666e\u901a HTTP \u4e2d&#xff0c;\u8bf7\u6c42\u548c\u54cd\u5e94\u5185\u5bb9\u901a\u5e38\u4ee5\u660e\u6587\u65b9\u5f0f\u5728\u7f51\u7edc\u4e2d\u4f20\u8f93\u3002<\/p>\n<p>\u4f8b\u5982\u4e0b\u9762\u7684\u767b\u5f55\u4fe1\u606f&#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token string-property property\">&#034;username&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;admin&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;password&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;123456&#034;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5982\u679c\u4f7f\u7528\u666e\u901a HTTP&#xff0c;\u5728\u4e0d\u5b89\u5168\u7f51\u7edc\u73af\u5883\u4e0b&#xff0c;\u653b\u51fb\u8005\u53ef\u80fd\u901a\u8fc7\u6293\u5305\u770b\u5230\u8fd9\u4e9b\u5185\u5bb9\u3002<\/p>\n<p>\u8fd9\u5c31\u662f HTTPS \u51fa\u73b0\u7684\u91cd\u8981\u539f\u56e0\u3002<\/p>\n<hr \/>\n<h2>\u5341\u3001HTTP \u5b58\u5728\u54ea\u4e9b\u5b89\u5168\u95ee\u9898<\/h2>\n<p>\u666e\u901a HTTP \u4e3b\u8981\u5b58\u5728\u4e09\u4e2a\u5b89\u5168\u95ee\u9898\u3002<\/p>\n<h3>1. \u7a83\u542c\u98ce\u9669<\/h3>\n<p>HTTP \u5185\u5bb9\u6ca1\u6709\u52a0\u5bc6\u3002<\/p>\n<p>\u653b\u51fb\u8005\u53ef\u80fd\u770b\u5230&#xff1a;<\/p>\n<ul>\n<li>\u7528\u6237\u540d&#xff1b;<\/li>\n<li>\u5bc6\u7801&#xff1b;<\/li>\n<li>Cookie&#xff1b;<\/li>\n<li>Token&#xff1b;<\/li>\n<li>\u804a\u5929\u5185\u5bb9&#xff1b;<\/li>\n<li>\u63a5\u53e3\u6570\u636e&#xff1b;<\/li>\n<li>\u7f51\u9875\u5185\u5bb9\u3002<\/li>\n<\/ul>\n<p>\u4f8b\u5982\u7528\u6237\u53d1\u9001&#xff1a;<\/p>\n<p>POST \/login HTTP\/1.1<br \/>\nContent-Type: application\/json<\/p>\n<p>{<br \/>\n    &#034;username&#034;: &#034;admin&#034;,<br \/>\n    &#034;password&#034;: &#034;123456&#034;<br \/>\n}<\/p>\n<p>\u5728\u666e\u901a HTTP \u4e2d&#xff0c;\u8fd9\u4e9b\u5185\u5bb9\u53ef\u80fd\u88ab\u76f4\u63a5\u8bfb\u53d6\u3002<\/p>\n<hr \/>\n<h3>2. \u7be1\u6539\u98ce\u9669<\/h3>\n<p>\u653b\u51fb\u8005\u4e0d\u4ec5\u53ef\u80fd\u8bfb\u53d6\u6570\u636e&#xff0c;\u8fd8\u53ef\u80fd\u4fee\u6539\u6570\u636e\u3002<\/p>\n<p>\u4f8b\u5982\u670d\u52a1\u5668\u539f\u672c\u8fd4\u56de&#xff1a;<\/p>\n<p>\u8bf7\u4e0b\u8f7d\u5b98\u65b9\u8f6f\u4ef6\u3002<\/p>\n<p>\u653b\u51fb\u8005\u53ef\u80fd\u5c06\u5176\u66ff\u6362\u4e3a&#xff1a;<\/p>\n<p>\u8bf7\u4e0b\u8f7d\u6076\u610f\u8f6f\u4ef6\u3002<\/p>\n<p>\u5ba2\u6237\u7aef\u5f88\u96be\u5224\u65ad\u6570\u636e\u662f\u5426\u5728\u4f20\u8f93\u8fc7\u7a0b\u4e2d\u88ab\u4fee\u6539\u3002<\/p>\n<hr \/>\n<h3>3. \u5192\u5145\u98ce\u9669<\/h3>\n<p>\u666e\u901a HTTP \u65e0\u6cd5\u53ef\u9760\u8bc1\u660e\u5f53\u524d\u670d\u52a1\u5668\u5c31\u662f\u7528\u6237\u60f3\u8bbf\u95ee\u7684\u670d\u52a1\u5668\u3002<\/p>\n<p>\u653b\u51fb\u8005\u53ef\u80fd\u5192\u5145\u771f\u5b9e\u670d\u52a1\u5668&#xff0c;\u5411\u7528\u6237\u53d1\u9001\u4f2a\u9020\u9875\u9762\u3002<\/p>\n<p>\u4f8b\u5982&#xff0c;\u7528\u6237\u4ee5\u4e3a\u81ea\u5df1\u8bbf\u95ee\u7684\u662f\u94f6\u884c\u7f51\u7ad9&#xff0c;\u5b9e\u9645\u4e0a\u8bbf\u95ee\u7684\u662f\u653b\u51fb\u8005\u4f2a\u9020\u7684\u7f51\u7ad9\u3002<\/p>\n<hr \/>\n<h2>\u5341\u4e00\u3001HTTPS \u662f\u4ec0\u4e48<\/h2>\n<p>HTTPS \u7684\u82f1\u6587\u901a\u5e38\u5199\u4f5c&#xff1a;<\/p>\n<p>HTTP Secure<\/p>\n<p>HTTPS \u53ef\u4ee5\u7406\u89e3\u4e3a&#xff1a;<\/p>\n<p>HTTPS &#061; HTTP &#043; TLS<\/p>\n<p>\u5f88\u591a\u65e7\u8d44\u6599\u4f1a\u5199&#xff1a;<\/p>\n<p>HTTPS &#061; HTTP &#043; SSL<\/p>\n<p>SSL \u662f TLS \u7684\u524d\u8eab\u3002\u73b0\u4ee3 HTTPS \u5b9e\u9645\u4e0a\u4e3b\u8981\u4f7f\u7528 TLS&#xff0c;\u56e0\u6b64\u66f4\u51c6\u786e\u7684\u8bf4\u6cd5\u662f&#xff1a;<\/p>\n<p>HTTPS \u662f\u8fd0\u884c\u5728 TLS \u5b89\u5168\u8fde\u63a5\u4e0a\u7684 HTTP\u3002<\/p>\n<p>HTTPS \u5e76\u6ca1\u6709\u6539\u53d8 HTTP \u7684\u57fa\u672c\u8bf7\u6c42\u548c\u54cd\u5e94\u8bed\u4e49\u3002<\/p>\n<p>\u4f8b\u5982&#xff0c;\u5728 HTTPS \u4e2d\u4ecd\u7136\u4f7f\u7528&#xff1a;<\/p>\n<ul>\n<li>GET&#xff1b;<\/li>\n<li>POST&#xff1b;<\/li>\n<li>PUT&#xff1b;<\/li>\n<li>DELETE&#xff1b;<\/li>\n<li>HTTP \u72b6\u6001\u7801&#xff1b;<\/li>\n<li>HTTP \u8bf7\u6c42\u5934&#xff1b;<\/li>\n<li>HTTP \u54cd\u5e94\u5934&#xff1b;<\/li>\n<li>JSON&#xff1b;<\/li>\n<li>Cookie\u3002<\/li>\n<\/ul>\n<p>HTTPS \u4e3b\u8981\u662f\u5728 HTTP \u6570\u636e\u8fdb\u5165\u7f51\u7edc\u4f20\u8f93\u4e4b\u524d&#xff0c;\u5bf9\u901a\u4fe1\u5185\u5bb9\u8fdb\u884c\u52a0\u5bc6\u548c\u5b8c\u6574\u6027\u4fdd\u62a4\u3002<\/p>\n<hr \/>\n<h2>\u5341\u4e8c\u3001HTTPS \u89e3\u51b3\u4e86\u54ea\u4e9b\u95ee\u9898<\/h2>\n<p>HTTPS \u4e3b\u8981\u63d0\u4f9b\u4e09\u4e2a\u5b89\u5168\u80fd\u529b\u3002<\/p>\n<h3>1. \u6570\u636e\u52a0\u5bc6<\/h3>\n<p>HTTPS \u4f1a\u5bf9\u4f20\u8f93\u5185\u5bb9\u8fdb\u884c\u52a0\u5bc6\u3002<\/p>\n<p>\u7f51\u7edc\u4e2d\u7684\u7b2c\u4e09\u65b9\u5373\u4f7f\u622a\u83b7\u6570\u636e&#xff0c;\u901a\u5e38\u4e5f\u53ea\u80fd\u770b\u5230\u52a0\u5bc6\u540e\u7684\u5185\u5bb9&#xff0c;\u65e0\u6cd5\u76f4\u63a5\u8bfb\u53d6\u539f\u59cb\u6570\u636e\u3002<\/p>\n<p>\u4f8b\u5982\u539f\u59cb\u5185\u5bb9\u662f&#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token string-property property\">&#034;password&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;123456&#034;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u7ecf\u8fc7 TLS \u52a0\u5bc6\u540e&#xff0c;\u7f51\u7edc\u4e2d\u4f20\u8f93\u7684\u662f\u7c7b\u4f3c\u4e0b\u9762\u7684\u4e0d\u53ef\u8bfb\u6570\u636e&#xff1a;<\/p>\n<p>8A 3F 91 C2 76 4D 0E &#8230;<\/p>\n<hr \/>\n<h3>2. \u8eab\u4efd\u8ba4\u8bc1<\/h3>\n<p>HTTPS \u901a\u8fc7\u6570\u5b57\u8bc1\u4e66\u9a8c\u8bc1\u670d\u52a1\u5668\u8eab\u4efd\u3002<\/p>\n<p>\u6d4f\u89c8\u5668\u4f1a\u68c0\u67e5&#xff1a;<\/p>\n<ul>\n<li>\u8bc1\u4e66\u662f\u5426\u7531\u53d7\u4fe1\u4efb\u7684\u8bc1\u4e66\u673a\u6784\u7b7e\u53d1&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u662f\u5426\u8fc7\u671f&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u4e2d\u7684\u57df\u540d\u662f\u5426\u4e0e\u5f53\u524d\u57df\u540d\u4e00\u81f4&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u662f\u5426\u88ab\u64a4\u9500&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u7b7e\u540d\u662f\u5426\u6709\u6548\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u6837\u53ef\u4ee5\u964d\u4f4e\u5ba2\u6237\u7aef\u8fde\u63a5\u5230\u4f2a\u9020\u670d\u52a1\u5668\u7684\u98ce\u9669\u3002<\/p>\n<hr \/>\n<h3>3. \u5b8c\u6574\u6027\u4fdd\u62a4<\/h3>\n<p>HTTPS \u53ef\u4ee5\u68c0\u6d4b\u4f20\u8f93\u6570\u636e\u662f\u5426\u88ab\u7be1\u6539\u3002<\/p>\n<p>\u5982\u679c\u653b\u51fb\u8005\u4fee\u6539\u4e86\u5bc6\u6587&#xff0c;\u5b8c\u6574\u6027\u6821\u9a8c\u901a\u5e38\u4f1a\u5931\u8d25&#xff0c;\u63a5\u6536\u65b9\u4f1a\u62d2\u7edd\u63a5\u53d7\u88ab\u7834\u574f\u7684\u6570\u636e\u3002<\/p>\n<p>\u56e0\u6b64 HTTPS \u89e3\u51b3\u7684\u4e09\u4e2a\u6838\u5fc3\u95ee\u9898\u53ef\u4ee5\u6982\u62ec\u4e3a&#xff1a;<\/p>\n<p>\u52a0\u5bc6&#xff1a;\u522b\u4eba\u770b\u4e0d\u61c2\u3002<br \/>\n\u8ba4\u8bc1&#xff1a;\u786e\u8ba4\u670d\u52a1\u5668\u8eab\u4efd\u3002<br \/>\n\u5b8c\u6574\u6027&#xff1a;\u53d1\u73b0\u6570\u636e\u88ab\u4fee\u6539\u3002<\/p>\n<hr \/>\n<h2>\u5341\u4e09\u3001HTTPS \u7684\u6574\u4f53\u901a\u4fe1\u6d41\u7a0b<\/h2>\n<p>\u8bbf\u95ee\u4e00\u4e2a HTTPS \u7f51\u7ad9\u65f6&#xff0c;\u6574\u4f53\u8fc7\u7a0b\u5982\u4e0b&#xff1a;<\/p>\n<p>1. \u89e3\u6790\u57df\u540d<br \/>\n2. \u5efa\u7acb TCP \u8fde\u63a5<br \/>\n3. \u8fdb\u884c TLS \u63e1\u624b<br \/>\n4. \u9a8c\u8bc1\u670d\u52a1\u5668\u8bc1\u4e66<br \/>\n5. \u534f\u5546\u52a0\u5bc6\u7b97\u6cd5\u548c\u4f1a\u8bdd\u5bc6\u94a5<br \/>\n6. \u5efa\u7acb\u5b89\u5168\u8fde\u63a5<br \/>\n7. \u53d1\u9001\u52a0\u5bc6\u540e\u7684 HTTP \u8bf7\u6c42<br \/>\n8. \u63a5\u6536\u52a0\u5bc6\u540e\u7684 HTTP \u54cd\u5e94<br \/>\n9. \u89e3\u5bc6\u5e76\u5904\u7406\u6570\u636e<\/p>\n<p>\u901a\u4fe1\u7ed3\u6784\u5982\u4e0b&#xff1a;<\/p>\n<p>\u5ba2\u6237\u7aef                                  \u670d\u52a1\u5668<\/p>\n<p>   &#8212;&#8212;&#8211; TCP \u4e09\u6b21\u63e1\u624b &#8212;&#8212;&#8212;&#8212;-&gt;<\/p>\n<p>   &lt;&#8212;&#8212;- TLS \u63e1\u624b\u4e0e\u8bc1\u4e66 &#8212;&#8212;&#8212;&#8212;<\/p>\n<p>   &#8212;&#8212;&#8211; \u5bc6\u94a5\u534f\u5546 &#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&gt;<\/p>\n<p>   &lt;&#061;&#061;&#061;&#061;&#061;&#061;&#061; \u52a0\u5bc6 HTTP \u6570\u636e &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&gt;<\/p>\n<p>\u9700\u8981\u8bf4\u660e\u7684\u662f&#xff0c;\u73b0\u4ee3 TLS \u63e1\u624b\u6bd4\u8fd9\u4e2a\u793a\u610f\u8fc7\u7a0b\u66f4\u590d\u6742&#xff0c;\u5b9e\u9645\u6d88\u606f\u6570\u91cf\u4e5f\u4f1a\u53d7\u5230 TLS \u7248\u672c\u3001\u8fde\u63a5\u590d\u7528\u548c\u4f1a\u8bdd\u6062\u590d\u7b49\u56e0\u7d20\u5f71\u54cd\u3002<\/p>\n<hr \/>\n<h2>\u5341\u56db\u3001\u6570\u5b57\u8bc1\u4e66\u662f\u4ec0\u4e48<\/h2>\n<p>\u6570\u5b57\u8bc1\u4e66\u53ef\u4ee5\u7406\u89e3\u4e3a\u670d\u52a1\u5668\u5728\u4e92\u8054\u7f51\u4e0a\u7684\u7535\u5b50\u8eab\u4efd\u8bc1\u3002<\/p>\n<p>\u8bc1\u4e66\u4e2d\u901a\u5e38\u5305\u542b&#xff1a;<\/p>\n<ul>\n<li>\u7f51\u7ad9\u57df\u540d&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u6301\u6709\u8005\u4fe1\u606f&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u9881\u53d1\u673a\u6784&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u6709\u6548\u671f&#xff1b;<\/li>\n<li>\u670d\u52a1\u5668\u516c\u94a5&#xff1b;<\/li>\n<li>\u7b7e\u540d\u7b97\u6cd5&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u9881\u53d1\u673a\u6784\u7684\u6570\u5b57\u7b7e\u540d\u3002<\/li>\n<\/ul>\n<p>\u4f8b\u5982&#xff0c;\u670d\u52a1\u5668\u8bc1\u4e66\u4e2d\u58f0\u660e&#xff1a;<\/p>\n<p>\u8be5\u516c\u94a5\u5c5e\u4e8e www.example.com<\/p>\n<p>\u540c\u65f6\u7531\u53d7\u4fe1\u4efb\u7684\u8bc1\u4e66\u673a\u6784\u5bf9\u8fd9\u4efd\u4fe1\u606f\u8fdb\u884c\u6570\u5b57\u7b7e\u540d\u3002<\/p>\n<p>\u6d4f\u89c8\u5668\u901a\u8fc7\u9a8c\u8bc1\u7b7e\u540d&#xff0c;\u5224\u65ad\u8bc1\u4e66\u662f\u5426\u53ef\u4fe1\u3002<\/p>\n<hr \/>\n<h2>\u5341\u4e94\u3001CA \u662f\u4ec0\u4e48<\/h2>\n<p>CA \u7684\u82f1\u6587\u5168\u79f0\u662f&#xff1a;<\/p>\n<p>Certificate Authority<\/p>\n<p>\u4e2d\u6587\u79f0\u4e3a&#xff1a;<\/p>\n<p>\u8bc1\u4e66\u9881\u53d1\u673a\u6784<\/p>\n<p>CA \u8d1f\u8d23\u7b7e\u53d1\u548c\u7ba1\u7406\u6570\u5b57\u8bc1\u4e66\u3002<\/p>\n<p>\u6d4f\u89c8\u5668\u548c\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u9884\u7f6e\u4e86\u4e00\u7ec4\u53d7\u4fe1\u4efb\u7684\u6839\u8bc1\u4e66\u3002<\/p>\n<p>\u670d\u52a1\u5668\u63d0\u4f9b\u8bc1\u4e66\u540e&#xff0c;\u6d4f\u89c8\u5668\u4f1a\u6cbf\u7740\u8bc1\u4e66\u94fe\u8fdb\u884c\u9a8c\u8bc1&#xff1a;<\/p>\n<p>\u7f51\u7ad9\u8bc1\u4e66<br \/>\n   \u2193<br \/>\n\u4e2d\u95f4\u8bc1\u4e66<br \/>\n   \u2193<br \/>\n\u6839\u8bc1\u4e66<\/p>\n<p>\u53ea\u8981\u8bc1\u4e66\u94fe\u6700\u7ec8\u53ef\u4ee5\u8fde\u63a5\u5230\u53d7\u4fe1\u4efb\u7684\u6839\u8bc1\u4e66&#xff0c;\u5e76\u4e14\u8bc1\u4e66\u6ee1\u8db3\u76f8\u5173\u6821\u9a8c\u6761\u4ef6&#xff0c;\u6d4f\u89c8\u5668\u5c31\u4f1a\u8ba4\u4e3a\u8be5\u8bc1\u4e66\u53ef\u4fe1\u3002<\/p>\n<hr \/>\n<h2>\u5341\u516d\u3001HTTPS \u4e3a\u4ec0\u4e48\u540c\u65f6\u4f7f\u7528\u975e\u5bf9\u79f0\u52a0\u5bc6\u548c\u5bf9\u79f0\u52a0\u5bc6<\/h2>\n<p>HTTPS \u5e76\u4e0d\u662f\u7b80\u5355\u5730\u4f7f\u7528\u4e00\u79cd\u52a0\u5bc6\u7b97\u6cd5\u5b8c\u6210\u6240\u6709\u5de5\u4f5c\u3002<\/p>\n<p>\u5b83\u901a\u5e38\u7ed3\u5408\u4f7f\u7528&#xff1a;<\/p>\n<ul>\n<li>\u975e\u5bf9\u79f0\u5bc6\u7801\u6280\u672f&#xff1b;<\/li>\n<li>\u5bf9\u79f0\u52a0\u5bc6&#xff1b;<\/li>\n<li>\u54c8\u5e0c\u548c\u6d88\u606f\u8ba4\u8bc1\u6280\u672f&#xff1b;<\/li>\n<li>\u6570\u5b57\u7b7e\u540d&#xff1b;<\/li>\n<li>\u5bc6\u94a5\u4ea4\u6362\u7b97\u6cd5\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>1. \u5bf9\u79f0\u52a0\u5bc6<\/h3>\n<p>\u5bf9\u79f0\u52a0\u5bc6\u4f7f\u7528\u540c\u4e00\u4e2a\u5bc6\u94a5\u5b8c\u6210\u52a0\u5bc6\u548c\u89e3\u5bc6\u3002<\/p>\n<p>\u660e\u6587 &#043; \u5bc6\u94a5 \u2192 \u5bc6\u6587<br \/>\n\u5bc6\u6587 &#043; \u540c\u4e00\u5bc6\u94a5 \u2192 \u660e\u6587<\/p>\n<p>\u4f18\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u52a0\u5bc6\u901f\u5ea6\u5feb&#xff1b;<\/li>\n<li>\u9002\u5408\u5927\u91cf\u6570\u636e\u4f20\u8f93&#xff1b;<\/li>\n<li>\u6027\u80fd\u5f00\u9500\u76f8\u5bf9\u8f83\u4f4e\u3002<\/li>\n<\/ul>\n<p>\u7f3a\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u5982\u4f55\u5b89\u5168\u5730\u5c06\u5bc6\u94a5\u4ea4\u7ed9\u901a\u4fe1\u53cc\u65b9&#xff0c;\u662f\u4e00\u4e2a\u95ee\u9898\u3002<\/li>\n<\/ul>\n<p>HTTPS \u5efa\u7acb\u8fde\u63a5\u540e&#xff0c;\u5927\u91cf HTTP \u6570\u636e\u4e3b\u8981\u901a\u8fc7\u5bf9\u79f0\u52a0\u5bc6\u4fdd\u62a4\u3002<\/p>\n<hr \/>\n<h3>2. \u975e\u5bf9\u79f0\u5bc6\u7801\u6280\u672f<\/h3>\n<p>\u975e\u5bf9\u79f0\u5bc6\u7801\u7cfb\u7edf\u4f7f\u7528\u4e00\u5bf9\u76f8\u5173\u5bc6\u94a5&#xff1a;<\/p>\n<p>\u516c\u94a5<br \/>\n\u79c1\u94a5<\/p>\n<p>\u516c\u94a5\u53ef\u4ee5\u516c\u5f00&#xff0c;\u79c1\u94a5\u9700\u8981\u7531\u6301\u6709\u8005\u79d8\u5bc6\u4fdd\u5b58\u3002<\/p>\n<p>\u975e\u5bf9\u79f0\u5bc6\u7801\u6280\u672f\u5e38\u7528\u4e8e&#xff1a;<\/p>\n<ul>\n<li>\u8eab\u4efd\u8ba4\u8bc1&#xff1b;<\/li>\n<li>\u6570\u5b57\u7b7e\u540d&#xff1b;<\/li>\n<li>\u5bc6\u94a5\u4ea4\u6362&#xff1b;<\/li>\n<li>\u5b89\u5168\u5efa\u7acb\u5171\u4eab\u5bc6\u94a5\u3002<\/li>\n<\/ul>\n<p>\u5b83\u7684\u4f18\u70b9\u662f\u66f4\u9002\u5408\u89e3\u51b3\u8eab\u4efd\u548c\u5bc6\u94a5\u534f\u5546\u95ee\u9898&#xff0c;\u4f46\u8ba1\u7b97\u6210\u672c\u901a\u5e38\u9ad8\u4e8e\u5bf9\u79f0\u52a0\u5bc6\u3002<\/p>\n<p>\u56e0\u6b64 HTTPS \u4e0d\u4f1a\u7b80\u5355\u5730\u4f7f\u7528\u975e\u5bf9\u79f0\u52a0\u5bc6\u6765\u52a0\u5bc6\u6240\u6709\u4e1a\u52a1\u6570\u636e\u3002<\/p>\n<hr \/>\n<h3>3. \u4e24\u8005\u7ed3\u5408<\/h3>\n<p>HTTPS \u7684\u6838\u5fc3\u601d\u60f3\u53ef\u4ee5\u7b80\u5316\u4e3a&#xff1a;<\/p>\n<p>\u5148\u901a\u8fc7 TLS \u63e1\u624b\u548c\u975e\u5bf9\u79f0\u5bc6\u7801\u673a\u5236\u5b8c\u6210\u8eab\u4efd\u8ba4\u8bc1\u4e0e\u5bc6\u94a5\u534f\u5546&#xff0c;<br \/>\n\u518d\u4f7f\u7528\u534f\u5546\u51fa\u7684\u5bf9\u79f0\u5bc6\u94a5\u52a0\u5bc6\u540e\u7eed HTTP \u6570\u636e\u3002<\/p>\n<p>\u8fd9\u6837\u540c\u65f6\u517c\u987e&#xff1a;<\/p>\n<ul>\n<li>\u5b89\u5168\u6027&#xff1b;<\/li>\n<li>\u8eab\u4efd\u8ba4\u8bc1&#xff1b;<\/li>\n<li>\u4f20\u8f93\u6027\u80fd\u3002<\/li>\n<\/ul>\n<hr \/>\n<h2>\u5341\u4e03\u3001HTTPS \u4e2d\u7684 TLS \u63e1\u624b\u8fc7\u7a0b<\/h2>\n<p>\u4ee5\u73b0\u4ee3 TLS \u4e3a\u4f8b&#xff0c;\u53ef\u4ee5\u5c06\u63e1\u624b\u8fc7\u7a0b\u7b80\u5316\u4e3a\u4ee5\u4e0b\u6b65\u9aa4\u3002<\/p>\n<h3>\u7b2c\u4e00\u6b65&#xff1a;\u5ba2\u6237\u7aef\u53d1\u9001\u63e1\u624b\u4fe1\u606f<\/h3>\n<p>\u5ba2\u6237\u7aef\u544a\u8bc9\u670d\u52a1\u5668&#xff1a;<\/p>\n<ul>\n<li>\u652f\u6301\u54ea\u4e9b TLS \u7248\u672c&#xff1b;<\/li>\n<li>\u652f\u6301\u54ea\u4e9b\u52a0\u5bc6\u5957\u4ef6&#xff1b;<\/li>\n<li>\u652f\u6301\u54ea\u4e9b\u5bc6\u94a5\u4ea4\u6362\u53c2\u6570&#xff1b;<\/li>\n<li>\u5ba2\u6237\u7aef\u968f\u673a\u6570&#xff1b;<\/li>\n<li>\u76ee\u6807\u57df\u540d&#xff1b;<\/li>\n<li>\u5176\u4ed6\u6269\u5c55\u80fd\u529b\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>\u7b2c\u4e8c\u6b65&#xff1a;\u670d\u52a1\u5668\u8fd4\u56de\u63e1\u624b\u4fe1\u606f\u548c\u8bc1\u4e66<\/h3>\n<p>\u670d\u52a1\u5668\u9009\u62e9\u53cc\u65b9\u90fd\u652f\u6301\u7684\u53c2\u6570&#xff0c;\u5e76\u8fd4\u56de&#xff1a;<\/p>\n<ul>\n<li>\u9009\u5b9a\u7684 TLS \u53c2\u6570&#xff1b;<\/li>\n<li>\u670d\u52a1\u5668\u8bc1\u4e66&#xff1b;<\/li>\n<li>\u5bc6\u94a5\u4ea4\u6362\u76f8\u5173\u53c2\u6570&#xff1b;<\/li>\n<li>\u670d\u52a1\u5668\u8eab\u4efd\u7b7e\u540d&#xff1b;<\/li>\n<li>\u5176\u4ed6\u63e1\u624b\u6570\u636e\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>\u7b2c\u4e09\u6b65&#xff1a;\u5ba2\u6237\u7aef\u9a8c\u8bc1\u8bc1\u4e66<\/h3>\n<p>\u5ba2\u6237\u7aef\u68c0\u67e5&#xff1a;<\/p>\n<ul>\n<li>\u8bc1\u4e66\u662f\u5426\u8fc7\u671f&#xff1b;<\/li>\n<li>\u57df\u540d\u662f\u5426\u5339\u914d&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u7b7e\u540d\u662f\u5426\u6b63\u786e&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u94fe\u662f\u5426\u53ef\u4fe1&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u662f\u5426\u5b58\u5728\u660e\u663e\u5f02\u5e38\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u9a8c\u8bc1\u5931\u8d25&#xff0c;\u6d4f\u89c8\u5668\u901a\u5e38\u4f1a\u663e\u793a\u7c7b\u4f3c\u63d0\u793a&#xff1a;<\/p>\n<p>\u60a8\u7684\u8fde\u63a5\u4e0d\u662f\u79c1\u5bc6\u8fde\u63a5<\/p>\n<hr \/>\n<h3>\u7b2c\u56db\u6b65&#xff1a;\u53cc\u65b9\u8ba1\u7b97\u4f1a\u8bdd\u5bc6\u94a5<\/h3>\n<p>\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u901a\u8fc7\u5bc6\u94a5\u4ea4\u6362\u7b97\u6cd5\u8ba1\u7b97\u5171\u4eab\u5bc6\u94a5\u6750\u6599\u3002<\/p>\n<p>\u53cc\u65b9\u5404\u81ea\u6839\u636e\u63e1\u624b\u4fe1\u606f\u751f\u6210\u76f8\u540c\u7684\u4f1a\u8bdd\u5bc6\u94a5&#xff0c;\u4f46\u5bc6\u94a5\u672c\u8eab\u4e0d\u9700\u8981\u76f4\u63a5\u4ee5\u660e\u6587\u5728\u7f51\u7edc\u4e2d\u4f20\u8f93\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e94\u6b65&#xff1a;\u9a8c\u8bc1\u63e1\u624b\u5b8c\u6574\u6027<\/h3>\n<p>\u53cc\u65b9\u786e\u8ba4&#xff1a;<\/p>\n<ul>\n<li>\u63e1\u624b\u8fc7\u7a0b\u6ca1\u6709\u88ab\u7be1\u6539&#xff1b;<\/li>\n<li>\u8ba1\u7b97\u51fa\u7684\u5bc6\u94a5\u4e00\u81f4&#xff1b;<\/li>\n<li>\u5bf9\u65b9\u638c\u63e1\u6b63\u786e\u7684\u5bc6\u94a5&#xff1b;<\/li>\n<li>\u53ef\u4ee5\u5f00\u59cb\u5b89\u5168\u901a\u4fe1\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>\u7b2c\u516d\u6b65&#xff1a;\u4f20\u8f93\u52a0\u5bc6\u540e\u7684 HTTP \u6570\u636e<\/h3>\n<p>\u4e4b\u540e\u7684 HTTP \u8bf7\u6c42\u548c\u54cd\u5e94\u90fd\u4f1a\u53d7\u5230 TLS \u52a0\u5bc6\u4fdd\u62a4\u3002<\/p>\n<p>HTTP \u8bf7\u6c42<br \/>\n   \u2193<br \/>\nTLS \u52a0\u5bc6<br \/>\n   \u2193<br \/>\n\u7f51\u7edc\u4f20\u8f93<br \/>\n   \u2193<br \/>\nTLS \u89e3\u5bc6<br \/>\n   \u2193<br \/>\n\u670d\u52a1\u5668\u5904\u7406<\/p>\n<hr \/>\n<h2>\u5341\u516b\u3001HTTP \u548c HTTPS \u7684\u4e3b\u8981\u533a\u522b<\/h2>\n<table>\n<tr>\u5bf9\u6bd4\u9879\u76eeHTTPHTTPS<\/tr>\n<tbody>\n<tr>\n<td>\u5b8c\u6574\u540d\u79f0<\/td>\n<td>\u8d85\u6587\u672c\u4f20\u8f93\u534f\u8bae<\/td>\n<td>\u4f7f\u7528 TLS \u4fdd\u62a4\u7684 HTTP<\/td>\n<\/tr>\n<tr>\n<td>\u9ed8\u8ba4\u7aef\u53e3<\/td>\n<td>80<\/td>\n<td>443<\/td>\n<\/tr>\n<tr>\n<td>\u6570\u636e\u4f20\u8f93<\/td>\n<td>\u901a\u5e38\u4e3a\u660e\u6587<\/td>\n<td>\u52a0\u5bc6\u4f20\u8f93<\/td>\n<\/tr>\n<tr>\n<td>\u670d\u52a1\u5668\u8eab\u4efd\u8ba4\u8bc1<\/td>\n<td>\u9ed8\u8ba4\u6ca1\u6709<\/td>\n<td>\u4f7f\u7528\u6570\u5b57\u8bc1\u4e66\u8ba4\u8bc1<\/td>\n<\/tr>\n<tr>\n<td>\u6570\u636e\u5b8c\u6574\u6027<\/td>\n<td>\u7f3a\u5c11\u5b89\u5168\u4fdd\u62a4<\/td>\n<td>\u53ef\u68c0\u6d4b\u4f20\u8f93\u7be1\u6539<\/td>\n<\/tr>\n<tr>\n<td>URL \u5f00\u5934<\/td>\n<td>http:\/\/<\/td>\n<td>https:\/\/<\/td>\n<\/tr>\n<tr>\n<td>\u662f\u5426\u9700\u8981\u8bc1\u4e66<\/td>\n<td>\u4e0d\u9700\u8981<\/td>\n<td>\u9700\u8981\u670d\u52a1\u5668\u8bc1\u4e66<\/td>\n<\/tr>\n<tr>\n<td>\u5b89\u5168\u6027<\/td>\n<td>\u8f83\u4f4e<\/td>\n<td>\u8f83\u9ad8<\/td>\n<\/tr>\n<tr>\n<td>\u6027\u80fd\u5f00\u9500<\/td>\n<td>\u8f83\u5c0f<\/td>\n<td>\u5b58\u5728 TLS \u5904\u7406\u5f00\u9500<\/td>\n<\/tr>\n<tr>\n<td>\u73b0\u4ee3\u7f51\u7ad9\u9002\u7528\u6027<\/td>\n<td>\u4e0d\u5efa\u8bae\u4f20\u8f93\u654f\u611f\u6570\u636e<\/td>\n<td>\u5e94\u4f5c\u4e3a\u9ed8\u8ba4\u9009\u62e9<\/td>\n<\/tr>\n<tr>\n<td>\u641c\u7d22\u5f15\u64ce\u4e0e\u6d4f\u89c8\u5668\u4f53\u9a8c<\/td>\n<td>\u53ef\u80fd\u88ab\u6807\u8bb0\u4e3a\u4e0d\u5b89\u5168<\/td>\n<td>\u66f4\u7b26\u5408\u73b0\u4ee3 Web \u8981\u6c42<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h2>\u5341\u4e5d\u3001HTTPS \u4f1a\u52a0\u5bc6\u54ea\u4e9b\u5185\u5bb9<\/h2>\n<p>HTTPS \u901a\u5e38\u4f1a\u4fdd\u62a4 HTTP \u5c42\u4e2d\u7684\u5185\u5bb9&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<ul>\n<li>\u8bf7\u6c42\u8def\u5f84&#xff1b;<\/li>\n<li>\u67e5\u8be2\u53c2\u6570&#xff1b;<\/li>\n<li>\u8bf7\u6c42\u5934&#xff1b;<\/li>\n<li>Cookie&#xff1b;<\/li>\n<li>Authorization&#xff1b;<\/li>\n<li>\u8bf7\u6c42\u4f53&#xff1b;<\/li>\n<li>\u54cd\u5e94\u5934&#xff1b;<\/li>\n<li>\u54cd\u5e94\u4f53&#xff1b;<\/li>\n<li>JSON \u6570\u636e&#xff1b;<\/li>\n<li>\u8868\u5355\u5185\u5bb9\u3002<\/li>\n<\/ul>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>https:\/\/example.com\/search?keyword&#061;password<\/p>\n<p>\u5176\u4e2d\u8def\u5f84\u548c\u67e5\u8be2\u53c2\u6570\u4f4d\u4e8e\u52a0\u5bc6\u540e\u7684 HTTP \u6570\u636e\u4e2d&#xff0c;\u666e\u901a\u4e2d\u95f4\u7f51\u7edc\u89c2\u5bdf\u8005\u901a\u5e38\u65e0\u6cd5\u76f4\u63a5\u770b\u5230\u5176\u5177\u4f53\u5185\u5bb9\u3002<\/p>\n<p>\u4f46\u662f HTTPS \u5e76\u4e0d\u80fd\u9690\u85cf\u6240\u6709\u7f51\u7edc\u4fe1\u606f\u3002<\/p>\n<p>\u67d0\u4e9b\u5e95\u5c42\u4fe1\u606f\u4ecd\u53ef\u80fd\u88ab\u89c2\u5bdf\u5230&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<ul>\n<li>\u901a\u4fe1\u53cc\u65b9 IP \u5730\u5740&#xff1b;<\/li>\n<li>\u8fde\u63a5\u65f6\u95f4&#xff1b;<\/li>\n<li>\u6570\u636e\u91cf\u5927\u5c0f&#xff1b;<\/li>\n<li>\u901a\u4fe1\u6301\u7eed\u65f6\u95f4&#xff1b;<\/li>\n<li>\u67d0\u4e9b\u63e1\u624b\u5143\u6570\u636e&#xff1b;<\/li>\n<li>DNS \u67e5\u8be2\u4fe1\u606f&#xff0c;\u53d6\u51b3\u4e8e\u662f\u5426\u4f7f\u7528\u52a0\u5bc6 DNS&#xff1b;<\/li>\n<li>\u5728\u90e8\u5206\u573a\u666f\u4e0b\u53ef\u80fd\u63a8\u6d4b\u51fa\u7684\u76ee\u6807\u7ad9\u70b9\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<p>\u56e0\u6b64&#xff0c;HTTPS \u7684\u4f5c\u7528\u662f\u4fdd\u62a4 HTTP \u901a\u4fe1\u5185\u5bb9&#xff0c;\u5e76\u4e0d\u7b49\u4e8e\u5b8c\u5168\u9690\u85cf\u6240\u6709\u7f51\u7edc\u884c\u4e3a\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u5341\u3001HTTPS \u4e0d\u4ee3\u8868\u7f51\u7ad9\u7edd\u5bf9\u5b89\u5168<\/h2>\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e38\u89c1\u8bef\u533a\u3002<\/p>\n<p>\u6d4f\u89c8\u5668\u663e\u793a\u5c0f\u9501\u6216 HTTPS&#xff0c;\u53ea\u80fd\u8bf4\u660e&#xff1a;<\/p>\n<p>\u5f53\u524d\u6d4f\u89c8\u5668\u4e0e\u8be5\u7f51\u7ad9\u4e4b\u95f4\u7684\u7f51\u7edc\u901a\u4fe1\u53d7\u5230 TLS \u4fdd\u62a4\u3002<\/p>\n<p>\u5b83\u4e0d\u80fd\u4fdd\u8bc1&#xff1a;<\/p>\n<ul>\n<li>\u7f51\u7ad9\u4e00\u5b9a\u662f\u5408\u6cd5\u7f51\u7ad9&#xff1b;<\/li>\n<li>\u7f51\u7ad9\u7a0b\u5e8f\u4e0d\u5b58\u5728\u6f0f\u6d1e&#xff1b;<\/li>\n<li>\u7f51\u7ad9\u6570\u636e\u5e93\u4e0d\u4f1a\u6cc4\u9732&#xff1b;<\/li>\n<li>\u7f51\u7ad9\u4e0d\u4f1a\u4fdd\u5b58\u660e\u6587\u5bc6\u7801&#xff1b;<\/li>\n<li>\u7f51\u7ad9\u8fd0\u8425\u8005\u4e00\u5b9a\u53ef\u4fe1&#xff1b;<\/li>\n<li>\u7528\u6237\u7535\u8111\u6ca1\u6709\u75c5\u6bd2&#xff1b;<\/li>\n<li>\u6d4f\u89c8\u5668\u63d2\u4ef6\u4e0d\u4f1a\u8bfb\u53d6\u9875\u9762\u5185\u5bb9&#xff1b;<\/li>\n<li>\u670d\u52a1\u5668\u4e0d\u4f1a\u4e3b\u52a8\u8bb0\u5f55\u7528\u6237\u6570\u636e\u3002<\/li>\n<\/ul>\n<p>\u9493\u9c7c\u7f51\u7ad9\u540c\u6837\u53ef\u4ee5\u7533\u8bf7 HTTPS \u8bc1\u4e66\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>https:\/\/fake-bank-example.com<\/p>\n<p>\u8fd9\u4e2a\u7f51\u7ad9\u53ef\u4ee5\u62e5\u6709\u6709\u6548\u8bc1\u4e66&#xff0c;\u4f46\u5b83\u4ecd\u53ef\u80fd\u662f\u9493\u9c7c\u7f51\u7ad9\u3002<\/p>\n<p>\u56e0\u6b64&#xff0c;\u7528\u6237\u8fd8\u9700\u8981\u68c0\u67e5&#xff1a;<\/p>\n<ul>\n<li>\u57df\u540d\u662f\u5426\u6b63\u786e&#xff1b;<\/li>\n<li>\u7f51\u7ad9\u4e3b\u4f53\u662f\u5426\u53ef\u4fe1&#xff1b;<\/li>\n<li>\u9875\u9762\u5185\u5bb9\u662f\u5426\u5f02\u5e38&#xff1b;<\/li>\n<li>\u662f\u5426\u8981\u6c42\u63d0\u4f9b\u4e0d\u5fc5\u8981\u7684\u654f\u611f\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<hr \/>\n<h2>\u4e8c\u5341\u4e00\u3001GET \u548c POST \u5728 HTTP \u4e0e HTTPS \u4e2d\u662f\u5426\u4e00\u6837<\/h2>\n<p>GET \u548c POST \u90fd\u662f HTTP \u8bf7\u6c42\u65b9\u6cd5&#xff0c;\u5728 HTTPS \u4e2d\u4ecd\u7136\u5b58\u5728\u3002<\/p>\n<p>\u533a\u522b\u5728\u4e8e&#xff1a;<\/p>\n<p>HTTP&#xff1a;GET \u548c POST \u5185\u5bb9\u901a\u5e38\u672a\u52a0\u5bc6\u3002<br \/>\nHTTPS&#xff1a;GET \u548c POST \u5185\u5bb9\u90fd\u4f1a\u53d7\u5230 TLS \u52a0\u5bc6\u4fdd\u62a4\u3002<\/p>\n<p>\u9700\u8981\u7279\u522b\u6ce8\u610f&#xff0c;\u4f7f\u7528 POST \u5e76\u4e0d\u80fd\u4ee3\u66ff HTTPS\u3002<\/p>\n<p>\u9519\u8bef\u7406\u89e3&#xff1a;<\/p>\n<p>POST \u53c2\u6570\u5728\u8bf7\u6c42\u4f53\u4e2d&#xff0c;\u6240\u4ee5\u4e00\u5b9a\u5b89\u5168\u3002<\/p>\n<p>\u6b63\u786e\u7406\u89e3&#xff1a;<\/p>\n<p>POST \u53ea\u662f\u5c06\u6570\u636e\u653e\u5728\u8bf7\u6c42\u4f53\u4e2d\u3002<br \/>\n\u5982\u679c\u4f7f\u7528\u666e\u901a HTTP&#xff0c;\u8bf7\u6c42\u4f53\u4ecd\u53ef\u80fd\u88ab\u76d1\u542c\u3002<\/p>\n<p>\u53e6\u5916&#xff0c;GET \u67e5\u8be2\u53c2\u6570\u5373\u4f7f\u5728 HTTPS \u4f20\u8f93\u4e2d\u53d7\u5230\u52a0\u5bc6&#xff0c;\u4e5f\u53ef\u80fd\u51fa\u73b0\u5728&#xff1a;<\/p>\n<ul>\n<li>\u6d4f\u89c8\u5668\u5386\u53f2\u8bb0\u5f55&#xff1b;<\/li>\n<li>\u670d\u52a1\u5668\u8bbf\u95ee\u65e5\u5fd7&#xff1b;<\/li>\n<li>\u4ee3\u7406\u65e5\u5fd7&#xff1b;<\/li>\n<li>\u5206\u6790\u7cfb\u7edf&#xff1b;<\/li>\n<li>Referer \u4fe1\u606f&#xff1b;<\/li>\n<li>\u7528\u6237\u590d\u5236\u7684\u94fe\u63a5\u4e2d\u3002<\/li>\n<\/ul>\n<p>\u56e0\u6b64\u5bc6\u7801\u3001Token \u7b49\u654f\u611f\u6570\u636e\u4e0d\u5e94\u8be5\u653e\u5728 URL \u67e5\u8be2\u53c2\u6570\u4e2d\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u5341\u4e8c\u3001HTTP\/1.0\u3001HTTP\/1.1\u3001HTTP\/2 \u548c HTTP\/3<\/h2>\n<h3>1. HTTP\/1.0<\/h3>\n<p>HTTP\/1.0 \u7684\u5178\u578b\u7279\u70b9\u662f&#xff1a;<\/p>\n<ul>\n<li>\u4e00\u4e2a TCP \u8fde\u63a5\u901a\u5e38\u53ea\u5904\u7406\u4e00\u4e2a\u8bf7\u6c42&#xff1b;<\/li>\n<li>\u8bf7\u6c42\u5b8c\u6210\u540e\u5173\u95ed\u8fde\u63a5&#xff1b;<\/li>\n<li>\u91cd\u590d\u5efa\u7acb TCP \u8fde\u63a5&#xff0c;\u5f00\u9500\u8f83\u5927\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>2. HTTP\/1.1<\/h3>\n<p>HTTP\/1.1 \u7684\u4e3b\u8981\u6539\u8fdb\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u9ed8\u8ba4\u652f\u6301\u6301\u4e45\u8fde\u63a5&#xff1b;<\/li>\n<li>\u652f\u6301\u5206\u5757\u4f20\u8f93&#xff1b;<\/li>\n<li>\u652f\u6301\u7f13\u5b58\u63a7\u5236&#xff1b;<\/li>\n<li>Host \u8bf7\u6c42\u5934\u6210\u4e3a\u5173\u952e\u673a\u5236&#xff1b;<\/li>\n<li>\u4e00\u4e2a TCP \u8fde\u63a5\u53ef\u4ee5\u8fde\u7eed\u5904\u7406\u591a\u4e2a\u8bf7\u6c42\u3002<\/li>\n<\/ul>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>Connection: keep-alive<\/p>\n<p>HTTP\/1.1 \u4ecd\u7136\u662f\u975e\u5e38\u5e38\u89c1\u7684\u534f\u8bae\u7248\u672c\u3002<\/p>\n<hr \/>\n<h3>3. HTTP\/2<\/h3>\n<p>HTTP\/2 \u7684\u4e3b\u8981\u7279\u70b9\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u4f7f\u7528\u4e8c\u8fdb\u5236\u5206\u5e27&#xff1b;<\/li>\n<li>\u652f\u6301\u591a\u8def\u590d\u7528&#xff1b;<\/li>\n<li>\u652f\u6301\u5934\u90e8\u538b\u7f29&#xff1b;<\/li>\n<li>\u4e00\u4e2a\u8fde\u63a5\u4e0a\u53ef\u4ee5\u5e76\u53d1\u4f20\u8f93\u591a\u4e2a\u8bf7\u6c42&#xff1b;<\/li>\n<li>\u51cf\u5c11 HTTP\/1.1 \u591a\u8fde\u63a5\u5e26\u6765\u7684\u5f00\u9500\u3002<\/li>\n<\/ul>\n<p>HTTP\/1.1 \u4e2d&#xff0c;\u6d4f\u89c8\u5668\u4e3a\u4e86\u63d0\u9ad8\u5e76\u53d1\u80fd\u529b&#xff0c;\u901a\u5e38\u9700\u8981\u5efa\u7acb\u591a\u4e2a TCP \u8fde\u63a5\u3002<\/p>\n<p>HTTP\/2 \u53ef\u4ee5\u5728\u4e00\u4e2a TCP \u8fde\u63a5\u4e2d\u4f20\u8f93\u591a\u4e2a\u5e76\u53d1\u6d41&#xff1a;<\/p>\n<p>\u4e00\u4e2a TCP \u8fde\u63a5<br \/>\n\u251c\u2500\u2500 \u8bf7\u6c42\u6d41 1<br \/>\n\u251c\u2500\u2500 \u8bf7\u6c42\u6d41 2<br \/>\n\u251c\u2500\u2500 \u8bf7\u6c42\u6d41 3<br \/>\n\u2514\u2500\u2500 \u8bf7\u6c42\u6d41 4<\/p>\n<p>\u4e0d\u8fc7&#xff0c;HTTP\/2 \u5e95\u5c42\u4ecd\u7136\u4f7f\u7528 TCP\u3002\u5f53 TCP \u5c42\u53d1\u751f\u4e22\u5305\u65f6&#xff0c;\u8fde\u63a5\u4e2d\u7684\u591a\u4e2a\u6d41\u53ef\u80fd\u90fd\u4f1a\u53d7\u5230\u5f71\u54cd\u3002<\/p>\n<hr \/>\n<h3>4. HTTP\/3<\/h3>\n<p>HTTP\/3 \u57fa\u4e8e QUIC&#xff0c;\u800c QUIC \u57fa\u4e8e UDP\u3002<\/p>\n<p>\u7ed3\u6784\u5982\u4e0b&#xff1a;<\/p>\n<p>HTTP\/3<br \/>\n  \u2193<br \/>\nQUIC<br \/>\n  \u2193<br \/>\nUDP<\/p>\n<p>HTTP\/3 \u7684\u4e3b\u8981\u76ee\u6807\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u51cf\u5c11\u8fde\u63a5\u5efa\u7acb\u5ef6\u8fdf&#xff1b;<\/li>\n<li>\u6539\u5584\u4e22\u5305\u60c5\u51b5\u4e0b\u7684\u591a\u8def\u590d\u7528\u8868\u73b0&#xff1b;<\/li>\n<li>\u66f4\u597d\u5730\u652f\u6301\u7f51\u7edc\u5207\u6362&#xff1b;<\/li>\n<li>\u96c6\u6210\u73b0\u4ee3\u5b89\u5168\u673a\u5236&#xff1b;<\/li>\n<li>\u63d0\u5347\u5f31\u7f51\u548c\u79fb\u52a8\u7f51\u7edc\u73af\u5883\u4e0b\u7684\u4f53\u9a8c\u3002<\/li>\n<\/ul>\n<p>HTTP\/3 \u5e76\u4e0d\u610f\u5473\u7740\u201c\u4e0d\u53ef\u9760\u201d\u3002<\/p>\n<p>\u867d\u7136 UDP \u672c\u8eab\u4e0d\u63d0\u4f9b TCP \u90a3\u6837\u7684\u53ef\u9760\u4f20\u8f93&#xff0c;\u4f46 QUIC \u5728 UDP \u4e4b\u4e0a\u5b9e\u73b0\u4e86&#xff1a;<\/p>\n<ul>\n<li>\u53ef\u9760\u4f20\u8f93&#xff1b;<\/li>\n<li>\u62e5\u585e\u63a7\u5236&#xff1b;<\/li>\n<li>\u91cd\u4f20\u673a\u5236&#xff1b;<\/li>\n<li>\u6d41\u91cf\u63a7\u5236&#xff1b;<\/li>\n<li>\u591a\u8def\u590d\u7528&#xff1b;<\/li>\n<li>\u52a0\u5bc6\u901a\u4fe1\u3002<\/li>\n<\/ul>\n<hr \/>\n<h2>\u4e8c\u5341\u4e09\u3001\u5982\u4f55\u4f7f\u7528 HTTP \u548c HTTPS<\/h2>\n<h3>1. \u4f7f\u7528\u6d4f\u89c8\u5668\u8bbf\u95ee<\/h3>\n<p>HTTP&#xff1a;<\/p>\n<p>http:\/\/example.com<\/p>\n<p>HTTPS&#xff1a;<\/p>\n<p>https:\/\/example.com<\/p>\n<p>\u73b0\u4ee3\u7f51\u7ad9\u5e94\u8be5\u4f18\u5148\u4f7f\u7528 HTTPS\u3002<\/p>\n<hr \/>\n<h3>2. \u4f7f\u7528 curl \u53d1\u9001 GET \u8bf7\u6c42<\/h3>\n<p><span class=\"token function\">curl<\/span> https:\/\/jsonplaceholder.typicode.com\/posts\/1<\/p>\n<p>\u663e\u793a\u54cd\u5e94\u5934&#xff1a;<\/p>\n<p><span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-i<\/span> https:\/\/jsonplaceholder.typicode.com\/posts\/1<\/p>\n<p>\u53ea\u67e5\u770b\u54cd\u5e94\u5934&#xff1a;<\/p>\n<p><span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-I<\/span> https:\/\/www.example.com<\/p>\n<p>\u67e5\u770b\u5b8c\u6574\u8fde\u63a5\u8fc7\u7a0b&#xff1a;<\/p>\n<p><span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-v<\/span> https:\/\/www.example.com<\/p>\n<p>-v \u53c2\u6570\u53ef\u4ee5\u67e5\u770b&#xff1a;<\/p>\n<ul>\n<li>DNS \u89e3\u6790\u7ed3\u679c&#xff1b;<\/li>\n<li>\u8fde\u63a5\u5730\u5740&#xff1b;<\/li>\n<li>TLS \u63e1\u624b\u4fe1\u606f&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u4fe1\u606f&#xff1b;<\/li>\n<li>HTTP \u8bf7\u6c42\u5934&#xff1b;<\/li>\n<li>HTTP \u54cd\u5e94\u5934\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>3. \u4f7f\u7528 curl \u53d1\u9001 POST \u8bf7\u6c42<\/h3>\n<p><span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-X<\/span> POST https:\/\/example.com\/api\/login <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">-H<\/span> <span class=\"token string\">&#034;Content-Type: application\/json&#034;<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">-d<\/span> <span class=\"token string\">&#039;{&#034;username&#034;:&#034;admin&#034;,&#034;password&#034;:&#034;123456&#034;}&#039;<\/span><\/p>\n<p>\u5176\u4e2d&#xff1a;<\/p>\n<p>-X POST                         \u6307\u5b9a\u8bf7\u6c42\u65b9\u6cd5<br \/>\n-H &#034;Content-Type: &#8230;&#034;          \u8bbe\u7f6e\u8bf7\u6c42\u5934<br \/>\n-d                              \u8bbe\u7f6e\u8bf7\u6c42\u4f53<\/p>\n<hr \/>\n<h3>4. \u4f7f\u7528 JavaScript \u53d1\u9001\u8bf7\u6c42<\/h3>\n<h4>fetch GET \u8bf7\u6c42<\/h4>\n<p><span class=\"token function\">fetch<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;https:\/\/example.com\/api\/users\/1001&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token function\">then<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">response<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>response<span class=\"token punctuation\">.<\/span>ok<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token keyword\">throw<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">Error<\/span><span class=\"token punctuation\">(<\/span><span class=\"token template-string\"><span class=\"token template-punctuation string\">&#096;<\/span><span class=\"token string\">HTTP error: <\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span>response<span class=\"token punctuation\">.<\/span>status<span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token template-punctuation string\">&#096;<\/span><\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><\/p>\n<p>        <span class=\"token keyword\">return<\/span> response<span class=\"token punctuation\">.<\/span><span class=\"token function\">json<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token function\">then<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">data<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span>data<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token function\">catch<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">error<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        console<span class=\"token punctuation\">.<\/span><span class=\"token function\">error<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u8bf7\u6c42\u5931\u8d25&#xff1a;&#034;<\/span><span class=\"token punctuation\">,<\/span> error<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h4>fetch POST \u8bf7\u6c42<\/h4>\n<p><span class=\"token function\">fetch<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;https:\/\/example.com\/api\/login&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token literal-property property\">method<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;POST&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token literal-property property\">headers<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token string-property property\">&#034;Content-Type&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;application\/json&#034;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token literal-property property\">body<\/span><span class=\"token operator\">:<\/span> <span class=\"token constant\">JSON<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">stringify<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token literal-property property\">username<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;admin&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token literal-property property\">password<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;123456&#034;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token function\">then<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">response<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>response<span class=\"token punctuation\">.<\/span>ok<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token keyword\">throw<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">Error<\/span><span class=\"token punctuation\">(<\/span><span class=\"token template-string\"><span class=\"token template-punctuation string\">&#096;<\/span><span class=\"token string\">HTTP error: <\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span>response<span class=\"token punctuation\">.<\/span>status<span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token template-punctuation string\">&#096;<\/span><\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><\/p>\n<p>        <span class=\"token keyword\">return<\/span> response<span class=\"token punctuation\">.<\/span><span class=\"token function\">json<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token function\">then<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">data<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u670d\u52a1\u5668\u8fd4\u56de&#xff1a;&#034;<\/span><span class=\"token punctuation\">,<\/span> data<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token function\">catch<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">error<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        console<span class=\"token punctuation\">.<\/span><span class=\"token function\">error<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u8bf7\u6c42\u5931\u8d25&#xff1a;&#034;<\/span><span class=\"token punctuation\">,<\/span> error<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<hr \/>\n<h3>5. \u4f7f\u7528 Python requests \u53d1\u9001 GET \u8bf7\u6c42<\/h3>\n<p>\u5148\u5b89\u88c5 requests&#xff1a;<\/p>\n<p>pip <span class=\"token function\">install<\/span> requests<\/p>\n<p>GET \u793a\u4f8b&#xff1a;<\/p>\n<p><span class=\"token keyword\">import<\/span> requests<\/p>\n<p>url <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;https:\/\/jsonplaceholder.typicode.com\/posts\/1&#034;<\/span><\/p>\n<p><span class=\"token keyword\">try<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    response <span class=\"token operator\">&#061;<\/span> requests<span class=\"token punctuation\">.<\/span>get<span class=\"token punctuation\">(<\/span>url<span class=\"token punctuation\">,<\/span> timeout<span class=\"token operator\">&#061;<\/span><span class=\"token number\">10<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    response<span class=\"token punctuation\">.<\/span>raise_for_status<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u72b6\u6001\u7801&#xff1a;&#034;<\/span><span class=\"token punctuation\">,<\/span> response<span class=\"token punctuation\">.<\/span>status_code<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u54cd\u5e94\u5934&#xff1a;&#034;<\/span><span class=\"token punctuation\">,<\/span> response<span class=\"token punctuation\">.<\/span>headers<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u54cd\u5e94\u6570\u636e&#xff1a;&#034;<\/span><span class=\"token punctuation\">,<\/span> response<span class=\"token punctuation\">.<\/span>json<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">except<\/span> requests<span class=\"token punctuation\">.<\/span>RequestException <span class=\"token keyword\">as<\/span> exc<span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u8bf7\u6c42\u5931\u8d25&#xff1a;&#034;<\/span><span class=\"token punctuation\">,<\/span> exc<span class=\"token punctuation\">)<\/span><\/p>\n<hr \/>\n<h3>6. \u4f7f\u7528 Python \u53d1\u9001 POST \u8bf7\u6c42<\/h3>\n<p><span class=\"token keyword\">import<\/span> requests<\/p>\n<p>url <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;https:\/\/example.com\/api\/login&#034;<\/span><\/p>\n<p>payload <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token string\">&#034;username&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;admin&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string\">&#034;password&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;123456&#034;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token keyword\">try<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    response <span class=\"token operator\">&#061;<\/span> requests<span class=\"token punctuation\">.<\/span>post<span class=\"token punctuation\">(<\/span><br \/>\n        url<span class=\"token punctuation\">,<\/span><br \/>\n        json<span class=\"token operator\">&#061;<\/span>payload<span class=\"token punctuation\">,<\/span><br \/>\n        timeout<span class=\"token operator\">&#061;<\/span><span class=\"token number\">10<\/span><br \/>\n    <span class=\"token punctuation\">)<\/span><\/p>\n<p>    response<span class=\"token punctuation\">.<\/span>raise_for_status<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u72b6\u6001\u7801&#xff1a;&#034;<\/span><span class=\"token punctuation\">,<\/span> response<span class=\"token punctuation\">.<\/span>status_code<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u54cd\u5e94\u5185\u5bb9&#xff1a;&#034;<\/span><span class=\"token punctuation\">,<\/span> response<span class=\"token punctuation\">.<\/span>text<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">except<\/span> requests<span class=\"token punctuation\">.<\/span>RequestException <span class=\"token keyword\">as<\/span> exc<span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u8bf7\u6c42\u5931\u8d25&#xff1a;&#034;<\/span><span class=\"token punctuation\">,<\/span> exc<span class=\"token punctuation\">)<\/span><\/p>\n<p>\u4f7f\u7528&#xff1a;<\/p>\n<p>json<span class=\"token operator\">&#061;<\/span>payload<\/p>\n<p>\u65f6&#xff0c;requests \u4f1a\u81ea\u52a8&#xff1a;<\/p>\n<ul>\n<li>\u5c06 Python \u5b57\u5178\u8f6c\u6362\u4e3a JSON&#xff1b;<\/li>\n<li>\u8bbe\u7f6e\u5408\u9002\u7684 Content-Type \u8bf7\u6c42\u5934\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>7. \u542f\u52a8\u4e00\u4e2a\u7b80\u5355 HTTP \u670d\u52a1\u5668<\/h3>\n<p>\u5728\u5b89\u88c5 Python \u7684\u76ee\u5f55\u4e2d\u6267\u884c&#xff1a;<\/p>\n<p>python <span class=\"token parameter variable\">-m<\/span> http.server <span class=\"token number\">8000<\/span><\/p>\n<p>\u7136\u540e\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee&#xff1a;<\/p>\n<p>http:\/\/127.0.0.1:8000<\/p>\n<p>\u6216\u8005&#xff1a;<\/p>\n<p>http:\/\/localhost:8000<\/p>\n<p>\u8fd9\u9002\u5408\u4e34\u65f6\u6d4b\u8bd5\u9759\u6001\u6587\u4ef6&#xff0c;\u4f46\u4e0d\u5efa\u8bae\u76f4\u63a5\u7528\u4e8e\u6b63\u5f0f\u751f\u4ea7\u73af\u5883\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u5341\u56db\u3001\u7f51\u7ad9\u5982\u4f55\u4ece HTTP \u5347\u7ea7\u4e3a HTTPS<\/h2>\n<p>\u7f51\u7ad9\u542f\u7528 HTTPS \u4e00\u822c\u9700\u8981\u4ee5\u4e0b\u6b65\u9aa4\u3002<\/p>\n<h3>\u7b2c\u4e00\u6b65&#xff1a;\u51c6\u5907\u57df\u540d<\/h3>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>www.example.com<\/p>\n<hr \/>\n<h3>\u7b2c\u4e8c\u6b65&#xff1a;\u7533\u8bf7 TLS \u8bc1\u4e66<\/h3>\n<p>\u53ef\u4ee5\u5411\u8bc1\u4e66\u670d\u52a1\u5546\u7533\u8bf7&#xff1a;<\/p>\n<ul>\n<li>\u514d\u8d39\u8bc1\u4e66&#xff1b;<\/li>\n<li>\u57df\u540d\u9a8c\u8bc1\u8bc1\u4e66&#xff1b;<\/li>\n<li>\u4f01\u4e1a\u9a8c\u8bc1\u8bc1\u4e66&#xff1b;<\/li>\n<li>\u591a\u57df\u540d\u8bc1\u4e66&#xff1b;<\/li>\n<li>\u901a\u914d\u7b26\u8bc1\u4e66\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>\u7b2c\u4e09\u6b65&#xff1a;\u5728\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u8bc1\u4e66<\/h3>\n<p>\u901a\u5e38\u9700\u8981\u914d\u7f6e&#xff1a;<\/p>\n<ul>\n<li>\u8bc1\u4e66\u6587\u4ef6&#xff1b;<\/li>\n<li>\u79c1\u94a5\u6587\u4ef6&#xff1b;<\/li>\n<li>\u4e2d\u95f4\u8bc1\u4e66\u94fe&#xff1b;<\/li>\n<li>HTTPS \u76d1\u542c\u7aef\u53e3\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>\u7b2c\u56db\u6b65&#xff1a;\u914d\u7f6e Web \u670d\u52a1\u5668<\/h3>\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5316\u7684 Nginx HTTPS \u914d\u7f6e\u793a\u4f8b&#xff1a;<\/p>\n<p>server {<br \/>\n    listen 443 ssl;<br \/>\n    server_name www.example.com;<\/p>\n<p>    ssl_certificate \/etc\/nginx\/cert\/fullchain.pem;<br \/>\n    ssl_certificate_key \/etc\/nginx\/cert\/private.key;<\/p>\n<p>    location \/ {<br \/>\n        root \/var\/www\/html;<br \/>\n        index index.html;<br \/>\n    }<br \/>\n}<\/p>\n<p>\u9700\u8981\u6ce8\u610f&#xff1a;<\/p>\n<ul>\n<li>\u79c1\u94a5\u6587\u4ef6\u5fc5\u987b\u59a5\u5584\u4fdd\u62a4&#xff1b;<\/li>\n<li>\u4e0d\u5e94\u8be5\u5c06\u79c1\u94a5\u4e0a\u4f20\u5230\u516c\u5f00\u4ee3\u7801\u4ed3\u5e93&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u8def\u5f84\u8981\u6839\u636e\u5b9e\u9645\u73af\u5883\u4fee\u6539&#xff1b;<\/li>\n<li>\u6b63\u5f0f\u73af\u5883\u8fd8\u9700\u8981\u8bbe\u7f6e\u5408\u7406\u7684 TLS \u5b89\u5168\u53c2\u6570\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>\u7b2c\u4e94\u6b65&#xff1a;\u5c06 HTTP \u91cd\u5b9a\u5411\u5230 HTTPS<\/h3>\n<p>Nginx \u793a\u4f8b&#xff1a;<\/p>\n<p>server {<br \/>\n    listen 80;<br \/>\n    server_name www.example.com;<\/p>\n<p>    return 301 https:\/\/$host$request_uri;<br \/>\n}<\/p>\n<p>\u8fd9\u6837\u7528\u6237\u8bbf\u95ee&#xff1a;<\/p>\n<p>http:\/\/www.example.com\/test<\/p>\n<p>\u4f1a\u88ab\u91cd\u5b9a\u5411\u5230&#xff1a;<\/p>\n<p>https:\/\/www.example.com\/test<\/p>\n<hr \/>\n<h3>\u7b2c\u516d\u6b65&#xff1a;\u4fee\u6539\u7f51\u7ad9\u5185\u90e8\u8d44\u6e90\u5730\u5740<\/h3>\n<p>\u7f51\u9875\u4e2d\u7684\u8d44\u6e90\u4e5f\u5e94\u8be5\u4f7f\u7528 HTTPS&#xff1a;<\/p>\n<p><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>script<\/span> <span class=\"token attr-name\">src<\/span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">&#061;<\/span><span class=\"token punctuation\">&#034;<\/span>https:\/\/example.com\/app.js<span class=\"token punctuation\">&#034;<\/span><\/span><span class=\"token punctuation\">&gt;<\/span><\/span><span class=\"token script\"><\/span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>script<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<p>\u4e0d\u80fd\u5728 HTTPS \u9875\u9762\u4e2d\u7ee7\u7eed\u52a0\u8f7d\u4e0d\u5b89\u5168\u7684 HTTP \u8d44\u6e90&#xff1a;<\/p>\n<p><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>script<\/span> <span class=\"token attr-name\">src<\/span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">&#061;<\/span><span class=\"token punctuation\">&#034;<\/span>http:\/\/example.com\/app.js<span class=\"token punctuation\">&#034;<\/span><\/span><span class=\"token punctuation\">&gt;<\/span><\/span><span class=\"token script\"><\/span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>script<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<p>\u5426\u5219\u53ef\u80fd\u4ea7\u751f\u6df7\u5408\u5185\u5bb9\u95ee\u9898\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u5341\u4e94\u3001\u4ec0\u4e48\u662f\u6df7\u5408\u5185\u5bb9<\/h2>\n<p>\u5f53\u4e00\u4e2a HTTPS \u9875\u9762\u52a0\u8f7d HTTP \u8d44\u6e90\u65f6&#xff0c;\u5c31\u4f1a\u4ea7\u751f\u6df7\u5408\u5185\u5bb9\u3002<\/p>\n<p>\u4f8b\u5982\u9875\u9762\u5730\u5740\u662f&#xff1a;<\/p>\n<p>https:\/\/www.example.com<\/p>\n<p>\u4f46\u9875\u9762\u4e2d\u5f15\u7528&#xff1a;<\/p>\n<p><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>script<\/span> <span class=\"token attr-name\">src<\/span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">&#061;<\/span><span class=\"token punctuation\">&#034;<\/span>http:\/\/cdn.example.com\/app.js<span class=\"token punctuation\">&#034;<\/span><\/span><span class=\"token punctuation\">&gt;<\/span><\/span><span class=\"token script\"><\/span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>script<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<p>\u6b64\u65f6\u9875\u9762\u672c\u8eab\u901a\u8fc7 HTTPS \u52a0\u8f7d&#xff0c;\u4f46 JavaScript \u6587\u4ef6\u901a\u8fc7 HTTP \u52a0\u8f7d\u3002<\/p>\n<p>\u653b\u51fb\u8005\u53ef\u80fd\u7be1\u6539\u8fd9\u4e2a JavaScript \u6587\u4ef6&#xff0c;\u4ece\u800c\u7834\u574f\u6574\u4e2a\u9875\u9762\u7684\u5b89\u5168\u6027\u3002<\/p>\n<p>\u6d4f\u89c8\u5668\u53ef\u80fd\u4f1a&#xff1a;<\/p>\n<ul>\n<li>\u963b\u6b62\u8d44\u6e90\u52a0\u8f7d&#xff1b;<\/li>\n<li>\u663e\u793a\u5b89\u5168\u8b66\u544a&#xff1b;<\/li>\n<li>\u5c06\u9875\u9762\u6807\u8bb0\u4e3a\u4e0d\u5b8c\u5168\u5b89\u5168\u3002<\/li>\n<\/ul>\n<p>\u89e3\u51b3\u65b9\u6cd5\u662f\u786e\u4fdd\u6240\u6709\u8d44\u6e90\u7edf\u4e00\u4f7f\u7528 HTTPS&#xff1a;<\/p>\n<p><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>script<\/span> <span class=\"token attr-name\">src<\/span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">&#061;<\/span><span class=\"token punctuation\">&#034;<\/span>https:\/\/cdn.example.com\/app.js<span class=\"token punctuation\">&#034;<\/span><\/span><span class=\"token punctuation\">&gt;<\/span><\/span><span class=\"token script\"><\/span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>script<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<hr \/>\n<h2>\u4e8c\u5341\u516d\u3001\u8bc1\u4e66\u5e38\u89c1\u9519\u8bef<\/h2>\n<h3>1. \u8bc1\u4e66\u8fc7\u671f<\/h3>\n<p>\u8bc1\u4e66\u8d85\u8fc7\u6709\u6548\u671f\u540e&#xff0c;\u6d4f\u89c8\u5668\u4f1a\u63d0\u793a\u8fde\u63a5\u4e0d\u5b89\u5168\u3002<\/p>\n<p>\u56e0\u6b64\u670d\u52a1\u5668\u9700\u8981\u53ca\u65f6\u7eed\u671f\u8bc1\u4e66\u3002<\/p>\n<hr \/>\n<h3>2. \u57df\u540d\u4e0d\u5339\u914d<\/h3>\n<p>\u4f8b\u5982\u8bc1\u4e66\u7b7e\u53d1\u7ed9&#xff1a;<\/p>\n<p>www.example.com<\/p>\n<p>\u4f46\u7528\u6237\u8bbf\u95ee&#xff1a;<\/p>\n<p>api.example.com<\/p>\n<p>\u5982\u679c\u8bc1\u4e66\u6ca1\u6709\u5305\u542b\u8be5\u57df\u540d&#xff0c;\u6d4f\u89c8\u5668\u4f1a\u63d0\u793a\u8bc1\u4e66\u57df\u540d\u4e0d\u5339\u914d\u3002<\/p>\n<hr \/>\n<h3>3. \u8bc1\u4e66\u94fe\u4e0d\u5b8c\u6574<\/h3>\n<p>\u670d\u52a1\u5668\u53ea\u914d\u7f6e\u7f51\u7ad9\u8bc1\u4e66&#xff0c;\u6ca1\u6709\u6b63\u786e\u914d\u7f6e\u4e2d\u95f4\u8bc1\u4e66&#xff0c;\u90e8\u5206\u5ba2\u6237\u7aef\u53ef\u80fd\u65e0\u6cd5\u5efa\u7acb\u53ef\u4fe1\u8bc1\u4e66\u94fe\u3002<\/p>\n<hr \/>\n<h3>4. \u4f7f\u7528\u81ea\u7b7e\u540d\u8bc1\u4e66<\/h3>\n<p>\u81ea\u7b7e\u540d\u8bc1\u4e66\u7531\u670d\u52a1\u5668\u81ea\u5df1\u7b7e\u53d1&#xff0c;\u4e0d\u662f\u7531\u6d4f\u89c8\u5668\u4fe1\u4efb\u7684 CA \u7b7e\u53d1\u3002<\/p>\n<p>\u5b83\u53ef\u4ee5\u63d0\u4f9b\u52a0\u5bc6&#xff0c;\u4f46\u6d4f\u89c8\u5668\u9ed8\u8ba4\u65e0\u6cd5\u786e\u8ba4\u5176\u8eab\u4efd\u53ef\u4fe1&#xff0c;\u56e0\u6b64\u4f1a\u663e\u793a\u8b66\u544a\u3002<\/p>\n<p>\u81ea\u7b7e\u540d\u8bc1\u4e66\u9002\u5408&#xff1a;<\/p>\n<ul>\n<li>\u672c\u5730\u5f00\u53d1&#xff1b;<\/li>\n<li>\u6d4b\u8bd5\u73af\u5883&#xff1b;<\/li>\n<li>\u5185\u90e8\u7f51\u7edc&#xff1b;<\/li>\n<li>\u5df2\u7ecf\u624b\u52a8\u5b89\u88c5\u4fe1\u4efb\u8bc1\u4e66\u7684\u4e13\u7528\u8bbe\u5907\u3002<\/li>\n<\/ul>\n<p>\u4e0d\u9002\u5408\u76f4\u63a5\u7528\u4e8e\u666e\u901a\u516c\u5171\u7f51\u7ad9\u3002<\/p>\n<hr \/>\n<h3>5. \u670d\u52a1\u5668\u65f6\u95f4\u9519\u8bef<\/h3>\n<p>\u8bc1\u4e66\u9a8c\u8bc1\u4f9d\u8d56\u7cfb\u7edf\u65f6\u95f4\u3002<\/p>\n<p>\u5982\u679c\u5ba2\u6237\u7aef\u6216\u670d\u52a1\u5668\u65f6\u95f4\u4e25\u91cd\u9519\u8bef&#xff0c;\u53ef\u80fd\u5bfc\u81f4\u8bc1\u4e66\u88ab\u5224\u65ad\u4e3a&#xff1a;<\/p>\n<ul>\n<li>\u5c1a\u672a\u751f\u6548&#xff1b;<\/li>\n<li>\u5df2\u7ecf\u8fc7\u671f\u3002<\/li>\n<\/ul>\n<hr \/>\n<h2>\u4e8c\u5341\u4e03\u3001HTTPS \u662f\u5426\u4f1a\u964d\u4f4e\u6027\u80fd<\/h2>\n<p>HTTPS \u786e\u5b9e\u9700\u8981\u8fdb\u884c&#xff1a;<\/p>\n<ul>\n<li>TLS \u63e1\u624b&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u9a8c\u8bc1&#xff1b;<\/li>\n<li>\u5bc6\u94a5\u534f\u5546&#xff1b;<\/li>\n<li>\u6570\u636e\u52a0\u5bc6&#xff1b;<\/li>\n<li>\u6570\u636e\u89e3\u5bc6&#xff1b;<\/li>\n<li>\u5b8c\u6574\u6027\u6821\u9a8c\u3002<\/li>\n<\/ul>\n<p>\u56e0\u6b64\u7406\u8bba\u4e0a\u4f1a\u589e\u52a0\u4e00\u5b9a\u5f00\u9500\u3002<\/p>\n<p>\u4f46\u5728\u73b0\u4ee3\u786c\u4ef6\u3001TLS \u534f\u8bae\u4f18\u5316\u3001\u8fde\u63a5\u590d\u7528\u3001\u4f1a\u8bdd\u6062\u590d\u3001HTTP\/2 \u548c HTTP\/3 \u7b49\u6280\u672f\u652f\u6301\u4e0b&#xff0c;\u8fd9\u90e8\u5206\u5f00\u9500\u901a\u5e38\u662f\u53ef\u4ee5\u63a5\u53d7\u7684\u3002<\/p>\n<p>HTTPS \u8fd8\u53ef\u4ee5\u914d\u5408&#xff1a;<\/p>\n<ul>\n<li>HTTP\/2&#xff1b;<\/li>\n<li>HTTP\/3&#xff1b;<\/li>\n<li>CDN&#xff1b;<\/li>\n<li>TLS \u4f1a\u8bdd\u6062\u590d&#xff1b;<\/li>\n<li>OCSP Stapling&#xff1b;<\/li>\n<li>\u957f\u8fde\u63a5&#xff1b;<\/li>\n<li>\u7f13\u5b58&#xff1b;<\/li>\n<li>\u538b\u7f29&#xff1b;<\/li>\n<li>\u8fb9\u7f18\u8282\u70b9\u3002<\/li>\n<\/ul>\n<p>\u56e0\u6b64&#xff0c;\u5b9e\u9645\u9879\u76ee\u4e2d\u4e0d\u80fd\u56e0\u4e3a\u62c5\u5fc3\u5c11\u91cf\u6027\u80fd\u635f\u8017\u800c\u653e\u5f03 HTTPS\u3002<\/p>\n<p>\u5b89\u5168\u6027\u901a\u5e38\u6bd4\u8fd9\u90e8\u5206\u6027\u80fd\u5f00\u9500\u66f4\u52a0\u91cd\u8981\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u5341\u516b\u3001HTTP \u91cd\u5b9a\u5411\u5230 HTTPS \u662f\u5426\u5df2\u7ecf\u8db3\u591f\u5b89\u5168<\/h2>\n<p>\u5c06 HTTP \u91cd\u5b9a\u5411\u5230 HTTPS \u662f\u5fc5\u8981\u64cd\u4f5c&#xff0c;\u4f46\u8fd8\u53ef\u4ee5\u8fdb\u4e00\u6b65\u542f\u7528 HSTS\u3002<\/p>\n<p>HSTS \u7684\u5b8c\u6574\u540d\u79f0\u662f&#xff1a;<\/p>\n<p>HTTP Strict Transport Security<\/p>\n<p>\u670d\u52a1\u5668\u53ef\u4ee5\u8fd4\u56de&#xff1a;<\/p>\n<p>Strict-Transport-Security: max-age&#061;31536000; includeSubDomains<\/p>\n<p>\u5b83\u544a\u8bc9\u6d4f\u89c8\u5668&#xff1a;<\/p>\n<p>\u5728\u6307\u5b9a\u65f6\u95f4\u5185&#xff0c;\u8be5\u7f51\u7ad9\u53ea\u80fd\u901a\u8fc7 HTTPS \u8bbf\u95ee\u3002<\/p>\n<p>\u8fd9\u6837\u53ef\u4ee5\u51cf\u5c11\u7528\u6237\u8bef\u8bbf\u95ee HTTP \u5730\u5740\u4ee5\u53ca\u90e8\u5206\u964d\u7ea7\u653b\u51fb\u98ce\u9669\u3002<\/p>\n<p>\u9700\u8981\u8c28\u614e\u914d\u7f6e HSTS&#xff0c;\u5c24\u5176\u662f&#xff1a;<\/p>\n<ul>\n<li>max-age&#xff1b;<\/li>\n<li>includeSubDomains&#xff1b;<\/li>\n<li>\u9884\u52a0\u8f7d\u5217\u8868\u3002<\/li>\n<\/ul>\n<p>\u9519\u8bef\u914d\u7f6e\u53ef\u80fd\u5bfc\u81f4\u7f51\u7ad9\u6216\u5b50\u57df\u540d\u65e0\u6cd5\u901a\u8fc7 HTTP \u4e34\u65f6\u8bbf\u95ee\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u5341\u4e5d\u3001Cookie \u5728 HTTPS \u4e2d\u5982\u4f55\u8bbe\u7f6e\u66f4\u5b89\u5168<\/h2>\n<p>\u670d\u52a1\u5668\u8bbe\u7f6e\u767b\u5f55 Cookie \u65f6&#xff0c;\u53ef\u4ee5\u4f7f\u7528&#xff1a;<\/p>\n<p>Set-Cookie: session_id&#061;abc123; Secure; HttpOnly; SameSite&#061;Lax<\/p>\n<p>\u5176\u4e2d&#xff1a;<\/p>\n<h3>Secure<\/h3>\n<p>Secure<\/p>\n<p>\u8868\u793a Cookie \u53ea\u901a\u8fc7 HTTPS \u53d1\u9001\u3002<\/p>\n<h3>HttpOnly<\/h3>\n<p>HttpOnly<\/p>\n<p>\u8868\u793a\u524d\u7aef JavaScript \u4e0d\u80fd\u76f4\u63a5\u8bfb\u53d6\u8be5 Cookie&#xff0c;\u6709\u52a9\u4e8e\u964d\u4f4e\u90e8\u5206 XSS \u653b\u51fb\u5bfc\u81f4\u7684 Cookie \u7a83\u53d6\u98ce\u9669\u3002<\/p>\n<h3>SameSite<\/h3>\n<p>SameSite&#061;Lax<\/p>\n<p>\u7528\u4e8e\u9650\u5236\u8de8\u7ad9\u8bf7\u6c42\u643a\u5e26 Cookie&#xff0c;\u6709\u52a9\u4e8e\u964d\u4f4e CSRF \u98ce\u9669\u3002<\/p>\n<p>\u9700\u8981\u6ce8\u610f&#xff0c;HTTPS \u53ea\u662f Web \u5b89\u5168\u7684\u4e00\u90e8\u5206&#xff0c;\u8fd8\u9700\u8981\u7ed3\u5408&#xff1a;<\/p>\n<ul>\n<li>\u8f93\u5165\u6821\u9a8c&#xff1b;<\/li>\n<li>\u6743\u9650\u63a7\u5236&#xff1b;<\/li>\n<li>SQL \u6ce8\u5165\u9632\u62a4&#xff1b;<\/li>\n<li>XSS \u9632\u62a4&#xff1b;<\/li>\n<li>CSRF \u9632\u62a4&#xff1b;<\/li>\n<li>\u5bc6\u7801\u54c8\u5e0c\u5b58\u50a8&#xff1b;<\/li>\n<li>\u5b89\u5168\u65e5\u5fd7&#xff1b;<\/li>\n<li>\u8bbf\u95ee\u63a7\u5236&#xff1b;<\/li>\n<li>\u9650\u6d41\u673a\u5236\u3002<\/li>\n<\/ul>\n<hr \/>\n<h2>\u4e09\u5341\u3001\u5982\u4f55\u5224\u65ad\u7f51\u7ad9\u662f\u5426\u4f7f\u7528 HTTPS<\/h2>\n<p>\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u5224\u65ad\u3002<\/p>\n<h3>\u65b9\u6cd5\u4e00&#xff1a;\u67e5\u770b\u5730\u5740\u680f<\/h3>\n<p>HTTPS \u5730\u5740\u4ee5&#xff1a;<\/p>\n<p>https:\/\/<\/p>\n<p>\u5f00\u5934\u3002<\/p>\n<hr \/>\n<h3>\u65b9\u6cd5\u4e8c&#xff1a;\u67e5\u770b\u6d4f\u89c8\u5668\u5b89\u5168\u4fe1\u606f<\/h3>\n<p>\u70b9\u51fb\u5730\u5740\u680f\u5de6\u4fa7\u7684\u5b89\u5168\u56fe\u6807&#xff0c;\u53ef\u4ee5\u67e5\u770b&#xff1a;<\/p>\n<ul>\n<li>\u5f53\u524d\u8fde\u63a5\u662f\u5426\u52a0\u5bc6&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u9881\u53d1\u5bf9\u8c61&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u9881\u53d1\u673a\u6784&#xff1b;<\/li>\n<li>\u8bc1\u4e66\u6709\u6548\u671f&#xff1b;<\/li>\n<li>\u57df\u540d\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>\u65b9\u6cd5\u4e09&#xff1a;\u4f7f\u7528 curl<\/h3>\n<p>\u6267\u884c&#xff1a;<\/p>\n<p><span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-v<\/span> https:\/\/www.example.com<\/p>\n<p>\u53ef\u4ee5\u770b\u5230 TLS \u8fde\u63a5\u548c\u8bc1\u4e66\u76f8\u5173\u4fe1\u606f\u3002<\/p>\n<hr \/>\n<h3>\u65b9\u6cd5\u56db&#xff1a;\u4f7f\u7528 OpenSSL<\/h3>\n<p>\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u670d\u52a1\u5668\u8bc1\u4e66&#xff1a;<\/p>\n<p>openssl s_client <span class=\"token parameter variable\">-connect<\/span> www.example.com:443 <span class=\"token parameter variable\">-servername<\/span> www.example.com<\/p>\n<p>\u5176\u4e2d&#xff1a;<\/p>\n<p>-connect<\/p>\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u5730\u5740\u548c\u7aef\u53e3&#xff1b;<\/p>\n<p>-servername<\/p>\n<p>\u7528\u4e8e\u53d1\u9001 SNI \u57df\u540d\u4fe1\u606f\u3002<\/p>\n<hr \/>\n<h2>\u4e09\u5341\u4e00\u3001HTTP \u6293\u5305\u4e0e HTTPS \u6293\u5305\u7684\u533a\u522b<\/h2>\n<h3>HTTP \u6293\u5305<\/h3>\n<p>\u666e\u901a HTTP \u62a5\u6587\u901a\u5e38\u53ef\u4ee5\u76f4\u63a5\u770b\u5230&#xff1a;<\/p>\n<p>POST \/login HTTP\/1.1<br \/>\nHost: example.com<br \/>\nContent-Type: application\/json<\/p>\n<p>{<br \/>\n    &#034;username&#034;: &#034;admin&#034;,<br \/>\n    &#034;password&#034;: &#034;123456&#034;<br \/>\n}<\/p>\n<hr \/>\n<h3>HTTPS \u6293\u5305<\/h3>\n<p>HTTPS \u62a5\u6587\u7ecf\u8fc7 TLS \u52a0\u5bc6\u540e&#xff0c;\u6293\u5305\u5de5\u5177\u901a\u5e38\u53ea\u80fd\u770b\u5230&#xff1a;<\/p>\n<ul>\n<li>IP \u5730\u5740&#xff1b;<\/li>\n<li>\u7aef\u53e3&#xff1b;<\/li>\n<li>TCP \u6216 QUIC \u6570\u636e&#xff1b;<\/li>\n<li>TLS \u63e1\u624b\u4fe1\u606f&#xff1b;<\/li>\n<li>\u52a0\u5bc6\u540e\u7684\u5e94\u7528\u6570\u636e&#xff1b;<\/li>\n<li>\u6570\u636e\u957f\u5ea6&#xff1b;<\/li>\n<li>\u901a\u4fe1\u65f6\u95f4\u3002<\/li>\n<\/ul>\n<p>\u65e0\u6cd5\u76f4\u63a5\u770b\u5230 HTTP \u8bf7\u6c42\u4f53\u548c\u54cd\u5e94\u4f53\u3002<\/p>\n<p>\u5728\u5408\u6cd5\u7684\u672c\u5730\u8c03\u8bd5\u73af\u5883\u4e2d&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u5ba2\u6237\u7aef\u4ee3\u7406\u3001\u5f00\u53d1\u8005\u5de5\u5177\u6216\u5bfc\u51fa\u4f1a\u8bdd\u5bc6\u94a5\u7b49\u65b9\u5f0f\u5206\u6790 HTTPS \u5185\u5bb9&#xff0c;\u4f46\u524d\u63d0\u662f\u5ba2\u6237\u7aef\u4fe1\u4efb\u8c03\u8bd5\u8bc1\u4e66\u6216\u638c\u63e1\u5bf9\u5e94\u4f1a\u8bdd\u4fe1\u606f\u3002<\/p>\n<p>\u4e0d\u5f97\u5728\u672a\u7ecf\u6388\u6743\u7684\u60c5\u51b5\u4e0b\u622a\u83b7\u4ed6\u4eba\u7684\u7f51\u7edc\u901a\u4fe1\u3002<\/p>\n<hr \/>\n<h2>\u4e09\u5341\u4e8c\u3001HTTP \u548c HTTPS \u7684\u5e38\u89c1\u8bef\u533a<\/h2>\n<h3>\u8bef\u533a\u4e00&#xff1a;POST \u6bd4 GET \u5b89\u5168<\/h3>\n<p>\u4e0d\u4e00\u5b9a\u3002<\/p>\n<p>GET \u548c POST \u662f\u5426\u52a0\u5bc6&#xff0c;\u53d6\u51b3\u4e8e\u662f\u5426\u4f7f\u7528 HTTPS\u3002<\/p>\n<p>\u666e\u901a HTTP \u4e0b&#xff0c;GET \u548c POST \u90fd\u53ef\u80fd\u88ab\u76d1\u542c\u3002<\/p>\n<hr \/>\n<h3>\u8bef\u533a\u4e8c&#xff1a;\u6709 HTTPS \u5c31\u4e0d\u4f1a\u88ab\u653b\u51fb<\/h3>\n<p>\u9519\u8bef\u3002<\/p>\n<p>HTTPS \u4e3b\u8981\u4fdd\u62a4\u4f20\u8f93\u8fc7\u7a0b&#xff0c;\u4e0d\u80fd\u81ea\u52a8\u4fee\u590d&#xff1a;<\/p>\n<ul>\n<li>SQL \u6ce8\u5165&#xff1b;<\/li>\n<li>XSS&#xff1b;<\/li>\n<li>CSRF&#xff1b;<\/li>\n<li>\u5f31\u5bc6\u7801&#xff1b;<\/li>\n<li>\u8d8a\u6743\u8bbf\u95ee&#xff1b;<\/li>\n<li>\u6587\u4ef6\u4e0a\u4f20\u6f0f\u6d1e&#xff1b;<\/li>\n<li>\u670d\u52a1\u5668\u6f0f\u6d1e&#xff1b;<\/li>\n<li>\u6570\u636e\u5e93\u6cc4\u9732\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>\u8bef\u533a\u4e09&#xff1a;HTTPS \u4f1a\u8ba9\u7f51\u7ad9\u975e\u5e38\u6162<\/h3>\n<p>\u73b0\u4ee3 HTTPS \u7684\u6027\u80fd\u5f00\u9500\u901a\u5e38\u53ef\u63a7\u3002<\/p>\n<p>\u5408\u7406\u4f7f\u7528\u8fde\u63a5\u590d\u7528\u3001HTTP\/2\u3001HTTP\/3\u3001\u7f13\u5b58\u548c CDN \u540e&#xff0c;HTTPS \u5b8c\u5168\u53ef\u4ee5\u6ee1\u8db3\u9ad8\u6027\u80fd\u7f51\u7ad9\u9700\u6c42\u3002<\/p>\n<hr \/>\n<h3>\u8bef\u533a\u56db&#xff1a;\u81ea\u7b7e\u540d\u8bc1\u4e66\u6ca1\u6709\u52a0\u5bc6\u4f5c\u7528<\/h3>\n<p>\u81ea\u7b7e\u540d\u8bc1\u4e66\u4ecd\u7136\u53ef\u4ee5\u5efa\u7acb\u52a0\u5bc6\u8fde\u63a5\u3002<\/p>\n<p>\u95ee\u9898\u5728\u4e8e\u5ba2\u6237\u7aef\u9ed8\u8ba4\u65e0\u6cd5\u786e\u8ba4\u8be5\u8bc1\u4e66\u5bf9\u5e94\u7684\u8eab\u4efd\u662f\u5426\u53ef\u4fe1&#xff0c;\u56e0\u6b64\u6d4f\u89c8\u5668\u4f1a\u663e\u793a\u5b89\u5168\u8b66\u544a\u3002<\/p>\n<hr \/>\n<h3>\u8bef\u533a\u4e94&#xff1a;HTTPS \u53ef\u4ee5\u9690\u85cf\u670d\u52a1\u5668 IP<\/h3>\n<p>HTTPS \u4e3b\u8981\u52a0\u5bc6 HTTP \u5185\u5bb9&#xff0c;\u901a\u5e38\u4e0d\u4f1a\u9690\u85cf\u901a\u4fe1\u53cc\u65b9\u7684 IP \u5730\u5740\u3002<\/p>\n<hr \/>\n<h3>\u8bef\u533a\u516d&#xff1a;HTTPS \u4f1a\u52a0\u5bc6\u6d4f\u89c8\u5668\u5730\u5740\u680f\u548c\u672c\u5730\u5386\u53f2\u8bb0\u5f55<\/h3>\n<p>HTTPS \u4f1a\u4fdd\u62a4\u6570\u636e\u5728\u7f51\u7edc\u4f20\u8f93\u8fc7\u7a0b\u4e2d\u7684\u5185\u5bb9&#xff0c;\u4f46\u6d4f\u89c8\u5668\u672c\u5730\u4ecd\u53ef\u80fd\u4fdd\u5b58&#xff1a;<\/p>\n<ul>\n<li>\u5386\u53f2\u8bb0\u5f55&#xff1b;<\/li>\n<li>\u4e0b\u8f7d\u8bb0\u5f55&#xff1b;<\/li>\n<li>\u81ea\u52a8\u586b\u5145\u6570\u636e&#xff1b;<\/li>\n<li>\u7f13\u5b58&#xff1b;<\/li>\n<li>\u5b8c\u6574 URL\u3002<\/li>\n<\/ul>\n<p>\u56e0\u6b64\u4e0d\u80fd\u628a\u654f\u611f\u6570\u636e\u653e\u5165 URL\u3002<\/p>\n<hr \/>\n<h2>\u4e09\u5341\u4e09\u3001\u5b9e\u9645\u9879\u76ee\u5e94\u8be5\u4f7f\u7528 HTTP \u8fd8\u662f HTTPS<\/h2>\n<h3>\u53ef\u4ee5\u4e34\u65f6\u4f7f\u7528 HTTP \u7684\u573a\u666f<\/h3>\n<ul>\n<li>\u672c\u673a\u5f00\u53d1&#xff1b;<\/li>\n<li>\u5b8c\u5168\u9694\u79bb\u7684\u6d4b\u8bd5\u7f51\u7edc&#xff1b;<\/li>\n<li>\u4e34\u65f6\u9759\u6001\u6587\u4ef6\u670d\u52a1\u5668&#xff1b;<\/li>\n<li>\u4e0d\u6d89\u53ca\u654f\u611f\u6570\u636e\u7684\u5b9e\u9a8c\u73af\u5883&#xff1b;<\/li>\n<li>\u67d0\u4e9b\u8d44\u6e90\u53d7\u9650\u7684\u5c01\u95ed\u5f0f\u8bbe\u5907\u901a\u4fe1\u3002<\/li>\n<\/ul>\n<p>\u5373\u4f7f\u5728\u5185\u7f51\u4e2d&#xff0c;\u4e5f\u9700\u8981\u8bc4\u4f30\u662f\u5426\u5b58\u5728\u76d1\u542c\u3001\u7be1\u6539\u548c\u6a2a\u5411\u79fb\u52a8\u98ce\u9669\u3002<\/p>\n<hr \/>\n<h3>\u5e94\u8be5\u4f7f\u7528 HTTPS \u7684\u573a\u666f<\/h3>\n<ul>\n<li>\u7528\u6237\u767b\u5f55&#xff1b;<\/li>\n<li>\u652f\u4ed8\u7cfb\u7edf&#xff1b;<\/li>\n<li>\u7535\u5546\u7f51\u7ad9&#xff1b;<\/li>\n<li>\u7ba1\u7406\u540e\u53f0&#xff1b;<\/li>\n<li>App \u63a5\u53e3&#xff1b;<\/li>\n<li>\u5c0f\u7a0b\u5e8f\u63a5\u53e3&#xff1b;<\/li>\n<li>\u6587\u4ef6\u4e0a\u4f20&#xff1b;<\/li>\n<li>\u4e2a\u4eba\u4fe1\u606f\u4f20\u8f93&#xff1b;<\/li>\n<li>Cookie \u548c Token \u4f20\u8f93&#xff1b;<\/li>\n<li>\u4f01\u4e1a\u7cfb\u7edf&#xff1b;<\/li>\n<li>\u4e91\u670d\u52a1\u63a5\u53e3&#xff1b;<\/li>\n<li>\u7269\u8054\u7f51\u8bbe\u5907\u8fdc\u7a0b\u7ba1\u7406&#xff1b;<\/li>\n<li>\u4efb\u4f55\u4e92\u8054\u7f51\u516c\u5f00\u670d\u52a1\u3002<\/li>\n<\/ul>\n<p>\u5bf9\u4e8e\u73b0\u4ee3\u4e92\u8054\u7f51\u670d\u52a1&#xff0c;\u53ef\u4ee5\u5c06 HTTPS \u89c6\u4e3a\u9ed8\u8ba4\u9009\u62e9\u3002<\/p>\n<hr \/>\n<h2>\u4e09\u5341\u56db\u3001HTTP \u4e0e HTTPS \u901a\u4fe1\u8fc7\u7a0b\u5bf9\u6bd4<\/h2>\n<h3>HTTP \u901a\u4fe1\u6d41\u7a0b<\/h3>\n<p>\u5ba2\u6237\u7aef<br \/>\n   \u2502<br \/>\n   \u2502 1. DNS \u89e3\u6790<br \/>\n   \u25bc<br \/>\n\u83b7\u5f97\u670d\u52a1\u5668 IP<br \/>\n   \u2502<br \/>\n   \u2502 2. TCP \u4e09\u6b21\u63e1\u624b<br \/>\n   \u25bc<br \/>\n\u5efa\u7acb TCP \u8fde\u63a5<br \/>\n   \u2502<br \/>\n   \u2502 3. \u53d1\u9001\u660e\u6587 HTTP \u8bf7\u6c42<br \/>\n   \u25bc<br \/>\n\u670d\u52a1\u5668\u5904\u7406<br \/>\n   \u2502<br \/>\n   \u2502 4. \u8fd4\u56de\u660e\u6587 HTTP \u54cd\u5e94<br \/>\n   \u25bc<br \/>\n\u5ba2\u6237\u7aef\u663e\u793a\u7ed3\u679c<\/p>\n<hr \/>\n<h3>HTTPS \u901a\u4fe1\u6d41\u7a0b<\/h3>\n<p>\u5ba2\u6237\u7aef<br \/>\n   \u2502<br \/>\n   \u2502 1. DNS \u89e3\u6790<br \/>\n   \u25bc<br \/>\n\u83b7\u5f97\u670d\u52a1\u5668 IP<br \/>\n   \u2502<br \/>\n   \u2502 2. TCP \u4e09\u6b21\u63e1\u624b<br \/>\n   \u25bc<br \/>\n\u5efa\u7acb TCP \u8fde\u63a5<br \/>\n   \u2502<br \/>\n   \u2502 3. TLS \u63e1\u624b<br \/>\n   \u2502 4. \u9a8c\u8bc1\u8bc1\u4e66<br \/>\n   \u2502 5. \u534f\u5546\u4f1a\u8bdd\u5bc6\u94a5<br \/>\n   \u25bc<br \/>\n\u5efa\u7acb\u5b89\u5168\u8fde\u63a5<br \/>\n   \u2502<br \/>\n   \u2502 6. \u53d1\u9001\u52a0\u5bc6 HTTP \u8bf7\u6c42<br \/>\n   \u25bc<br \/>\n\u670d\u52a1\u5668\u89e3\u5bc6\u5e76\u5904\u7406<br \/>\n   \u2502<br \/>\n   \u2502 7. \u8fd4\u56de\u52a0\u5bc6 HTTP \u54cd\u5e94<br \/>\n   \u25bc<br \/>\n\u5ba2\u6237\u7aef\u89e3\u5bc6\u5e76\u663e\u793a\u7ed3\u679c<\/p>\n<hr \/>\n<h2>\u4e09\u5341\u4e94\u3001\u603b\u7ed3<\/h2>\n<p>HTTP \u662f\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u8fdb\u884c\u6570\u636e\u4ea4\u6362\u7684\u5e94\u7528\u5c42\u534f\u8bae&#xff0c;\u91c7\u7528\u8bf7\u6c42\u548c\u54cd\u5e94\u6a21\u578b\u3002<\/p>\n<p>HTTP \u8bf7\u6c42\u4e3b\u8981\u7531\u4ee5\u4e0b\u90e8\u5206\u7ec4\u6210&#xff1a;<\/p>\n<p>\u8bf7\u6c42\u884c<br \/>\n\u8bf7\u6c42\u5934<br \/>\n\u7a7a\u884c<br \/>\n\u8bf7\u6c42\u4f53<\/p>\n<p>HTTP \u54cd\u5e94\u4e3b\u8981\u7531\u4ee5\u4e0b\u90e8\u5206\u7ec4\u6210&#xff1a;<\/p>\n<p>\u72b6\u6001\u884c<br \/>\n\u54cd\u5e94\u5934<br \/>\n\u7a7a\u884c<br \/>\n\u54cd\u5e94\u4f53<\/p>\n<p>HTTP \u5e38\u89c1\u8bf7\u6c42\u65b9\u6cd5\u5305\u62ec&#xff1a;<\/p>\n<p>GET<br \/>\nPOST<br \/>\nPUT<br \/>\nPATCH<br \/>\nDELETE<br \/>\nHEAD<br \/>\nOPTIONS<\/p>\n<p>\u666e\u901a HTTP \u4e3b\u8981\u5b58\u5728\u4ee5\u4e0b\u5b89\u5168\u95ee\u9898&#xff1a;<\/p>\n<p>\u6570\u636e\u53ef\u80fd\u88ab\u7a83\u542c<br \/>\n\u6570\u636e\u53ef\u80fd\u88ab\u7be1\u6539<br \/>\n\u670d\u52a1\u5668\u8eab\u4efd\u96be\u4ee5\u53ef\u9760\u786e\u8ba4<\/p>\n<p>HTTPS \u672c\u8d28\u4e0a\u662f&#xff1a;<\/p>\n<p>HTTPS &#061; HTTP &#043; TLS<\/p>\n<p>HTTPS \u4e3b\u8981\u63d0\u4f9b&#xff1a;<\/p>\n<p>\u6570\u636e\u52a0\u5bc6<br \/>\n\u670d\u52a1\u5668\u8eab\u4efd\u8ba4\u8bc1<br \/>\n\u6570\u636e\u5b8c\u6574\u6027\u4fdd\u62a4<\/p>\n<p>HTTP \u548c HTTPS \u7684\u6838\u5fc3\u533a\u522b\u4e0d\u662f\u8bf7\u6c42\u65b9\u6cd5\u4e0d\u540c&#xff0c;\u4e5f\u4e0d\u662f\u4f20\u8f93\u6570\u636e\u683c\u5f0f\u4e0d\u540c&#xff0c;\u800c\u662f&#xff1a;<\/p>\n<p>HTTPS \u5728 HTTP \u901a\u4fe1\u5916\u589e\u52a0\u4e86 TLS \u5b89\u5168\u4fdd\u62a4\u3002<\/p>\n<p>\u5728\u73b0\u4ee3 Web \u5f00\u53d1\u4e2d&#xff0c;\u53ea\u8981\u7cfb\u7edf\u6d89\u53ca\u767b\u5f55\u3001Cookie\u3001Token\u3001\u4e2a\u4eba\u4fe1\u606f\u3001\u652f\u4ed8\u4fe1\u606f\u3001\u6587\u4ef6\u4e0a\u4f20\u6216\u4e92\u8054\u7f51\u516c\u5f00\u8bbf\u95ee&#xff0c;\u5c31\u5e94\u8be5\u4f18\u5148\u4f7f\u7528 HTTPS\u3002<\/p>\n<p>\u6700\u540e\u53ef\u4ee5\u7528\u4e00\u53e5\u8bdd\u603b\u7ed3&#xff1a;<\/p>\n<p>HTTP \u8d1f\u8d23\u89c4\u5b9a\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u5982\u4f55\u4ea4\u6362\u6570\u636e&#xff0c;HTTPS \u5219\u5728 HTTP \u7684\u57fa\u7840\u4e0a&#xff0c;\u901a\u8fc7 TLS \u4fdd\u62a4\u6570\u636e\u4e0d\u88ab\u8f7b\u6613\u7a83\u542c\u3001\u7be1\u6539\u548c\u5192\u5145\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HTTP \u548c HTTPS \u8be6\u89e3&#xff1a;\u5de5\u4f5c\u539f\u7406\u3001\u901a\u4fe1\u6d41\u7a0b\u3001\u4f7f\u7528\u65b9\u6cd5\u53ca\u6838\u5fc3\u533a\u522b<br \/>\n\u524d\u8a00<br \/>\n\u5728\u6d4f\u89c8\u5668\u5730\u5740\u680f\u4e2d\u8f93\u5165\u4e00\u4e2a\u7f51\u5740\u65f6&#xff0c;\u901a\u5e38\u4f1a\u770b\u5230\u4e0b\u9762\u4e24\u79cd\u5f62\u5f0f&#xff1a;<br \/>\nhttp:\/\/www.example.com<br \/>\nhttps:\/\/www.example.com\u5176\u4e2d&#xff1a;<br \/>\nHTTP \u662f\u8d85\u6587\u672c\u4f20\u8f93\u534f\u8bae&#xff1b;HTTPS \u662f\u4f7f\u7528 TLS \u52a0\u5bc6\u4fdd\u62a4\u7684 HTTP&#xff1b;HTTP \u9ed8\u8ba4\u4f7f\u7528 80 \u7aef\u53e3&#xff1b;HTTPS \u9ed8\u8ba4\u4f7f\u7528 443<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9126,191,1080,996],"topic":[],"class_list":["post-87795","post","type-post","status-publish","format-standard","hentry","category-server","tag-9126","tag-191","tag-1080","tag-996"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>HTTP \u548c HTTPS \u8be6\u89e3\uff1a\u5de5\u4f5c\u539f\u7406\u3001\u901a\u4fe1\u6d41\u7a0b\u3001\u4f7f\u7528\u65b9\u6cd5\u53ca\u6838\u5fc3\u533a\u522b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/87795.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HTTP \u548c HTTPS \u8be6\u89e3\uff1a\u5de5\u4f5c\u539f\u7406\u3001\u901a\u4fe1\u6d41\u7a0b\u3001\u4f7f\u7528\u65b9\u6cd5\u53ca\u6838\u5fc3\u533a\u522b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"HTTP \u548c HTTPS \u8be6\u89e3&#xff1a;\u5de5\u4f5c\u539f\u7406\u3001\u901a\u4fe1\u6d41\u7a0b\u3001\u4f7f\u7528\u65b9\u6cd5\u53ca\u6838\u5fc3\u533a\u522b \u524d\u8a00 \u5728\u6d4f\u89c8\u5668\u5730\u5740\u680f\u4e2d\u8f93\u5165\u4e00\u4e2a\u7f51\u5740\u65f6&#xff0c;\u901a\u5e38\u4f1a\u770b\u5230\u4e0b\u9762\u4e24\u79cd\u5f62\u5f0f&#xff1a; http:\/\/www.example.com https:\/\/www.example.com\u5176\u4e2d&#xff1a; HTTP \u662f\u8d85\u6587\u672c\u4f20\u8f93\u534f\u8bae&#xff1b;HTTPS \u662f\u4f7f\u7528 TLS \u52a0\u5bc6\u4fdd\u62a4\u7684 HTTP&#xff1b;HTTP \u9ed8\u8ba4\u4f7f\u7528 80 \u7aef\u53e3&#xff1b;HTTPS \u9ed8\u8ba4\u4f7f\u7528 443\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/87795.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-30T14:08:32+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/87795.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/87795.html\",\"name\":\"HTTP \u548c HTTPS \u8be6\u89e3\uff1a\u5de5\u4f5c\u539f\u7406\u3001\u901a\u4fe1\u6d41\u7a0b\u3001\u4f7f\u7528\u65b9\u6cd5\u53ca\u6838\u5fc3\u533a\u522b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-30T14:08:32+00:00\",\"dateModified\":\"2026-07-30T14:08:32+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/87795.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/87795.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/87795.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HTTP \u548c HTTPS \u8be6\u89e3\uff1a\u5de5\u4f5c\u539f\u7406\u3001\u901a\u4fe1\u6d41\u7a0b\u3001\u4f7f\u7528\u65b9\u6cd5\u53ca\u6838\u5fc3\u533a\u522b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HTTP \u548c HTTPS \u8be6\u89e3\uff1a\u5de5\u4f5c\u539f\u7406\u3001\u901a\u4fe1\u6d41\u7a0b\u3001\u4f7f\u7528\u65b9\u6cd5\u53ca\u6838\u5fc3\u533a\u522b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/87795.html","og_locale":"zh_CN","og_type":"article","og_title":"HTTP \u548c HTTPS \u8be6\u89e3\uff1a\u5de5\u4f5c\u539f\u7406\u3001\u901a\u4fe1\u6d41\u7a0b\u3001\u4f7f\u7528\u65b9\u6cd5\u53ca\u6838\u5fc3\u533a\u522b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"HTTP \u548c HTTPS \u8be6\u89e3&#xff1a;\u5de5\u4f5c\u539f\u7406\u3001\u901a\u4fe1\u6d41\u7a0b\u3001\u4f7f\u7528\u65b9\u6cd5\u53ca\u6838\u5fc3\u533a\u522b \u524d\u8a00 \u5728\u6d4f\u89c8\u5668\u5730\u5740\u680f\u4e2d\u8f93\u5165\u4e00\u4e2a\u7f51\u5740\u65f6&#xff0c;\u901a\u5e38\u4f1a\u770b\u5230\u4e0b\u9762\u4e24\u79cd\u5f62\u5f0f&#xff1a; http:\/\/www.example.com https:\/\/www.example.com\u5176\u4e2d&#xff1a; HTTP \u662f\u8d85\u6587\u672c\u4f20\u8f93\u534f\u8bae&#xff1b;HTTPS \u662f\u4f7f\u7528 TLS \u52a0\u5bc6\u4fdd\u62a4\u7684 HTTP&#xff1b;HTTP \u9ed8\u8ba4\u4f7f\u7528 80 \u7aef\u53e3&#xff1b;HTTPS \u9ed8\u8ba4\u4f7f\u7528 443","og_url":"https:\/\/www.wsisp.com\/helps\/87795.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-30T14:08:32+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"14 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/87795.html","url":"https:\/\/www.wsisp.com\/helps\/87795.html","name":"HTTP \u548c HTTPS \u8be6\u89e3\uff1a\u5de5\u4f5c\u539f\u7406\u3001\u901a\u4fe1\u6d41\u7a0b\u3001\u4f7f\u7528\u65b9\u6cd5\u53ca\u6838\u5fc3\u533a\u522b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-30T14:08:32+00:00","dateModified":"2026-07-30T14:08:32+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/87795.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/87795.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/87795.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"HTTP \u548c HTTPS \u8be6\u89e3\uff1a\u5de5\u4f5c\u539f\u7406\u3001\u901a\u4fe1\u6d41\u7a0b\u3001\u4f7f\u7528\u65b9\u6cd5\u53ca\u6838\u5fc3\u533a\u522b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/87795","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=87795"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/87795\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=87795"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=87795"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=87795"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=87795"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}