{"id":1933,"date":"2021-01-02T09:56:02","date_gmt":"2021-01-02T01:56:02","guid":{"rendered":"https:\/\/www.yusian.com\/blog\/?p=1933"},"modified":"2021-01-02T09:58:43","modified_gmt":"2021-01-02T01:58:43","slug":"%e6%9c%80%e7%ae%80%e5%8d%95%e7%9a%84http%e9%80%9a%e8%ae%af%e8%bf%87%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.yusian.com\/blog\/h5\/2021\/01\/02\/0956021933.html","title":{"rendered":"\u6700\u7b80\u5355\u7684HTTP\u901a\u8baf\u8fc7\u7a0b"},"content":{"rendered":"<p><strong>HTTP\u62a5\u6587\u9075\u5faaABNF(\u4e00\u79cd\u5f62\u5f0f\u5316\u7684\u8bed\u6cd5\u8868\u793a\u65b9\u5f0f)\uff0c\u7a7a\u683c\u6216\u56de\u8f66\u6362\u884c\u90fd\u6709\u4e25\u683c\u7684\u89c4\u5b9a\uff0c\u4ee5\u6b64\u4fdd\u8bc1HTTP\u534f\u8bae\u7684\u5b9e\u73b0<\/strong><\/p>\n<h4>1\u3001\u6700\u7b80\u5355\u7684HTTP\u8bf7\u6c42\u62a5\u6587<\/h4>\n<ul>\n<li>\u8bf7\u6c42\u884c\uff1a\u65b9\u6cd5<code>\u7a7a\u683c<\/code>URI<code>\u7a7a\u683c<\/code>HTTP\/&#42;.&#42;<code>\u56de\u8f66\u6362\u884c<\/code><\/li>\n<li>\u8bf7\u6c42\u5934(\u53ef\u9009\uff0c\u4ee5\u952e\u503c\u5bf9\u7684\u5f62\u5f0f)<\/li>\n<li>\u7a7a\u884c(\u56de\u8f66\u6362\u884c\uff0c\u8fd9\u4e00\u4e2a\u7a7a\u884c\u662f\u6709\u5b9e\u9645\u610f\u4e49\u7684\uff0c\u4ee3\u8868\u5934\u4e0e\u4f53\u7684\u5206\u9694\uff0c\u5fc5\u987b\u8981\u6709)\uff1a<code>\u56de\u8f66\u6362\u884c<\/code><\/li>\n<li>\u8bf7\u6c42\u4f53(\u53ef\u9009)<\/li>\n<\/ul>\n<pre><code class=\"language-shell line-numbers\">GET \/hello\/world HTTP\/1.1\nHost: localhost:8080\n\n<\/code><\/pre>\n<h4>2\u3001\u6700\u7b80\u5355\u7684HTTP\u54cd\u5e94\u62a5\u6587<\/h4>\n<ul>\n<li>\u54cd\u5e94\u884c\uff1aHTTP\/&#42;.&#42;<code>\u7a7a\u683c<\/code>\u72b6\u6001\u7801<code>\u7a7a\u683c<\/code>\u72b6\u6001\u63cf\u8ff0(\u53ef\u9009)<code>\u56de\u8f66\u6362\u884c<\/code><\/li>\n<li>\u54cd\u5e94\u5934(\u53ef\u9009\uff0c\u4ee5\u952e\u503c\u5bf9\u7684\u5f62\u5f0f)<\/li>\n<li>\u7a7a\u884c(\u5fc5\u9700)\uff1a<code>\u56de\u8f66\u6362\u884c<\/code><\/li>\n<li>\u54cd\u5e94\u4f53(\u53ef\u9009\uff0c\u4efb\u610f\u6570\u636e)<\/li>\n<\/ul>\n<pre><code class=\"language-shell line-numbers\">HTTP\/1.1 200 \nContent-Length: 11\n\nHello World\n<\/code><\/pre>\n<h4>3\u3001\u4f7f\u7528XShell\u8fdb\u884c\u7ec8\u7aef\u6a21\u62dfHTTP\u8bf7\u6c42<\/h4>\n<pre><code class=\"language-shell line-numbers\">[C:\\~]$ telnet localhost 8080\n\n\nHost 'localhost' resolved to ::1.\nConnecting to ::1:8080...\nConnection established.\nTo escape to local shell, press 'Ctrl+Alt+]'.\nGET \/hello\/world HTTP\/1.1\nHost:localhost:8080\n\nHTTP\/1.1 200 \nContent-Length: 11\nDate: Sat, 02 Jan 2021 01:47:23 GMT\n\nHello WorldConnection closing...Socket close.\n\nConnection closed by foreign host.\n\nDisconnected from remote host(localhost:8080) at 09:47:44.\n\nType `help' to learn how to use Xshell prompt.\n[C:\\~]$ \n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>HTTP\u62a5\u6587\u9075\u5faaABNF(\u4e00\u79cd\u5f62\u5f0f\u5316\u7684\u8bed\u6cd5\u8868\u793a\u65b9\u5f0f)\uff0c\u7a7a\u683c\u6216\u56de\u8f66\u6362\u884c\u90fd\u6709\u4e25\u683c\u7684\u89c4\u5b9a\uff0c\u4ee5\u6b64\u4fdd\u8bc1HTTP\u534f\u8bae\u7684\u5b9e\u73b0 1\u3001\u6700\u7b80\u5355\u7684HTTP\u8bf7\u6c42\u62a5\u6587 \u8bf7\u6c42\u884c\uff1a\u65b9\u6cd5\u7a7a\u683cURI\u7a7a\u683cHTTP\/&#42;.&#42;\u56de\u8f66\u6362\u884c \u8bf7\u6c42\u5934(\u53ef\u9009\uff0c\u4ee5\u952e\u503c\u5bf9\u7684\u5f62\u5f0f) \u7a7a\u884c(\u56de\u8f66\u6362\u884c\uff0c\u8fd9\u4e00\u4e2a\u7a7a\u884c\u662f\u6709\u5b9e\u9645\u610f\u4e49\u7684\uff0c\u4ee3\u8868\u5934\u4e0e\u4f53\u7684\u5206\u9694\uff0c\u5fc5\u987b\u8981\u6709)\uff1a\u56de\u8f66\u6362\u884c \u8bf7\u6c42\u4f53(\u53ef\u9009) GET \/hello\/world HTTP\/1.1 Host: localhost:8080 2\u3001\u6700\u7b80\u5355\u7684HTTP\u54cd\u5e94\u62a5\u6587 \u54cd\u5e94\u884c\uff1aHTTP\/&#42;.&#42;\u7a7a\u683c\u72b6\u6001\u7801\u7a7a\u683c\u72b6\u6001\u63cf\u8ff0(\u53ef\u9009)\u56de\u8f66\u6362\u884c \u54cd\u5e94\u5934(\u53ef\u9009\uff0c\u4ee5\u952e\u503c\u5bf9\u7684\u5f62\u5f0f) \u7a7a\u884c(\u5fc5\u9700)\uff1a\u56de\u8f66\u6362\u884c \u54cd\u5e94\u4f53(\u53ef\u9009\uff0c\u4efb\u610f\u6570\u636e) HTTP\/1.1 200 Content-Length: 11 Hello World 3\u3001\u4f7f\u7528XShell\u8fdb\u884c\u7ec8\u7aef\u6a21\u62dfHTTP\u8bf7\u6c42 [C:\\~]$ telnet localhost 8080 Host &#8216;localhost&#8217; resolved to ::1. Connecting to ::1:8080&#8230; Connection established. To escape to local shell, press &#8216;Ctrl+Alt+]&#8217;. GET \/hello\/world HTTP\/1.1 Host:localhost:8080 HTTP\/1.1 200 Content-Length: 11 Date: Sat, 02 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,35],"tags":[341,340],"class_list":["post-1933","post","type-post","status-publish","format-standard","hentry","category-h5","category-java","tag-http"],"_links":{"self":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/1933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/comments?post=1933"}],"version-history":[{"count":0,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/1933\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/media?parent=1933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/categories?post=1933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/tags?post=1933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}