{"id":2762,"date":"2019-05-29T11:47:47","date_gmt":"2019-05-29T03:47:47","guid":{"rendered":"https:\/\/www.baishitou.cn\/?p=2762"},"modified":"2019-05-29T11:47:47","modified_gmt":"2019-05-29T03:47:47","slug":"%e9%80%9a%e4%bf%97%e6%98%93%e6%87%82%e5%9c%b0%e7%bb%99%e4%bd%a0%e8%ae%b2%e8%ae%b2get%e5%92%8cpost%e4%b8%a4%e7%a7%8dhttp%e8%af%b7%e6%b1%82%e6%96%b9%e6%b3%95%e7%9a%84%e5%8c%ba%e5%88%ab","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/2762.html","title":{"rendered":"\u901a\u4fd7\u6613\u61c2\u5730\u7ed9\u4f60\u8bb2\u8bb2GET\u548cPOST\u4e24\u79cdHTTP\u8bf7\u6c42\u65b9\u6cd5\u7684\u533a\u522b"},"content":{"rendered":"
GET\u548cPOST\u662fHTTP\u8bf7\u6c42\u7684\u4e24\u79cd\u57fa\u672c\u65b9\u6cd5\uff0c\u8981\u8bf4\u5b83\u4eec\u7684\u533a\u522b\uff0c\u63a5\u89e6\u8fc7WEB\u5f00\u53d1\u7684\u4eba\u90fd\u80fd\u8bf4\u51fa\u4e00\u4e8c\u3002<\/p>\n
\u6700\u76f4\u89c2\u7684\u533a\u522b\u5c31\u662fGET\u628a\u53c2\u6570\u5305\u542b\u5728URL\u4e2d\uff0cPOST\u901a\u8fc7request body\u4f20\u9012\u53c2\u6570\u3002<\/p>\n
\u4f60\u53ef\u80fd\u81ea\u5df1\u5199\u8fc7\u65e0\u6570\u4e2aGET\u548cPOST\u8bf7\u6c42\uff0c\u6216\u8005\u5df2\u7ecf\u770b\u8fc7\u5f88\u591a\u6743\u5a01\u7f51\u7ad9\u603b\u7ed3\u51fa\u7684\u4ed6\u4eec\u7684\u533a\u522b\uff0c\u4f60\u975e\u5e38\u6e05\u695a\u77e5\u9053\u4ec0\u4e48\u65f6\u5019\u8be5\u7528\u4ec0\u4e48\u3002<\/p>\n
\u5f53\u4f60\u5728\u9762\u8bd5\u4e2d\u88ab\u95ee\u5230\u8fd9\u4e2a\u95ee\u9898\uff0c\u4f60\u7684\u5185\u5fc3\u5145\u6ee1\u4e86\u81ea\u4fe1\u548c\u559c\u60a6\u3002<\/p>\n
\u4f60\u8f7b\u8f7b\u677e\u677e\u7684\u7ed9\u51fa\u4e86\u4e00\u4e2a\u201c\u6807\u51c6\u7b54\u6848\u201d\uff1a<\/p>\n GET\u5728\u6d4f\u89c8\u5668\u56de\u9000\u65f6\u662f\u65e0\u5bb3\u7684\uff0c\u800cPOST\u4f1a\u518d\u6b21\u63d0\u4ea4\u8bf7\u6c42\u3002 \uff08\u672c\u6807\u51c6\u7b54\u6848\u53c2\u8003\u81eaw3schools\uff09<\/p>\n \u201c\u5f88\u9057\u61be\uff0c\u8fd9\u4e0d\u662f\u6211\u4eec\u8981\u7684\u56de\u7b54\uff01\u201d<\/p>\n \u8bf7\u544a\u8bc9\u6211\u771f\u76f8\u3002\u3002\u3002<\/p>\n \u5982\u679c\u6211\u544a\u8bc9\u4f60GET\u548cPOST\u672c\u8d28\u4e0a\u6ca1\u6709\u533a\u522b\u4f60\u4fe1\u5417\uff1f<\/p>\n \u8ba9\u6211\u4eec\u6252\u4e0bGET\u548cPOST\u7684\u5916\u8863\uff0c\u5766\u8bda\u76f8\u89c1\u5427\uff01<\/p>\n GET\u548cPOST\u662f\u4ec0\u4e48\uff1fHTTP\u534f\u8bae\u4e2d\u7684\u4e24\u79cd\u53d1\u9001\u8bf7\u6c42\u7684\u65b9\u6cd5\u3002<\/p>\n HTTP\u662f\u4ec0\u4e48\uff1fHTTP\u662f\u57fa\u4e8eTCP\/IP\u7684\u5173\u4e8e\u6570\u636e\u5982\u4f55\u5728\u4e07\u7ef4\u7f51\u4e2d\u5982\u4f55\u901a\u4fe1\u7684\u534f\u8bae\u3002<\/p>\n HTTP\u7684\u5e95\u5c42\u662fTCP\/IP\u3002\u6240\u4ee5GET\u548cPOST\u7684\u5e95\u5c42\u4e5f\u662fTCP\/IP\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0cGET\/POST\u90fd\u662fTCP\u94fe\u63a5\u3002GET\u548cPOST\u80fd\u505a\u7684\u4e8b\u60c5\u662f\u4e00\u6837\u4e00\u6837\u7684\u3002\u4f60\u8981\u7ed9GET\u52a0\u4e0arequest body\uff0c\u7ed9POST\u5e26\u4e0aurl\u53c2\u6570\uff0c\u6280\u672f\u4e0a\u662f\u5b8c\u5168\u884c\u7684\u901a\u7684\u3002<\/p>\n \u90a3\u4e48\uff0c\u201c\u6807\u51c6\u7b54\u6848\u201d\u91cc\u7684\u90a3\u4e9b\u533a\u522b\u662f\u600e\u4e48\u56de\u4e8b\uff1f<\/p>\n \u5728\u6211\u5927\u4e07\u7ef4\u7f51\u4e16\u754c\u4e2d\uff0cTCP\u5c31\u50cf\u6c7d\u8f66\uff0c\u6211\u4eec\u7528TCP\u6765\u8fd0\u8f93\u6570\u636e\uff0c\u5b83\u5f88\u53ef\u9760\uff0c\u4ece\u6765\u4e0d\u4f1a\u53d1\u751f\u4e22\u4ef6\u5c11\u4ef6\u7684\u73b0\u8c61\u3002\u4f46\u662f\u5982\u679c\u8def\u4e0a\u8dd1\u7684\u5168\u662f\u770b\u8d77\u6765\u4e00\u6a21\u4e00\u6837\u7684\u6c7d\u8f66\uff0c\u90a3\u8fd9\u4e2a\u4e16\u754c\u770b\u8d77\u6765\u662f\u4e00\u56e2\u6df7\u4e71\uff0c\u9001\u6025\u4ef6\u7684\u6c7d\u8f66\u53ef\u80fd\u88ab\u524d\u9762\u6ee1\u8f7d\u8d27\u7269\u7684\u6c7d\u8f66\u62e6\u5835\u5728\u8def\u4e0a\uff0c\u6574\u4e2a\u4ea4\u901a\u7cfb\u7edf\u4e00\u5b9a\u4f1a\u762b\u75ea\u3002\u4e3a\u4e86\u907f\u514d\u8fd9\u79cd\u60c5\u51b5\u53d1\u751f\uff0c\u4ea4\u901a\u89c4\u5219HTTP\u8bde\u751f\u4e86\u3002HTTP\u7ed9\u6c7d\u8f66\u8fd0\u8f93\u8bbe\u5b9a\u4e86\u597d\u51e0\u4e2a\u670d\u52a1\u7c7b\u522b\uff0c\u6709GET, POST, PUT, DELETE\u7b49\u7b49\uff0cHTTP\u89c4\u5b9a\uff0c\u5f53\u6267\u884cGET\u8bf7\u6c42\u7684\u65f6\u5019\uff0c\u8981\u7ed9\u6c7d\u8f66\u8d34\u4e0aGET\u7684\u6807\u7b7e\uff08\u8bbe\u7f6emethod\u4e3aGET\uff09\uff0c\u800c\u4e14\u8981\u6c42\u628a\u4f20\u9001\u7684\u6570\u636e\u653e\u5728\u8f66\u9876\u4e0a\uff08url\u4e2d\uff09\u4ee5\u65b9\u4fbf\u8bb0\u5f55\u3002\u5982\u679c\u662fPOST\u8bf7\u6c42\uff0c\u5c31\u8981\u5728\u8f66\u4e0a\u8d34\u4e0aPOST\u7684\u6807\u7b7e\uff0c\u5e76\u628a\u8d27\u7269\u653e\u5728\u8f66\u53a2\u91cc\u3002\u5f53\u7136\uff0c\u4f60\u4e5f\u53ef\u4ee5\u5728GET\u7684\u65f6\u5019\u5f80\u8f66\u53a2\u5185\u5077\u5077\u85cf\u70b9\u8d27\u7269\uff0c\u4f46\u662f\u8fd9\u662f\u5f88\u4e0d\u5149\u5f69\uff1b\u4e5f\u53ef\u4ee5\u5728POST\u7684\u65f6\u5019\u5728\u8f66\u9876\u4e0a\u4e5f\u653e\u4e00\u4e9b\u6570\u636e\uff0c\u8ba9\u4eba\u89c9\u5f97\u50bb\u4e4e\u4e4e\u7684\u3002HTTP\u53ea\u662f\u4e2a\u884c\u4e3a\u51c6\u5219\uff0c\u800cTCP\u624d\u662fGET\u548cPOST\u600e\u4e48\u5b9e\u73b0\u7684\u57fa\u672c\u3002<\/p>\n \u4f46\u662f\uff0c\u6211\u4eec\u53ea\u770b\u5230HTTP\u5bf9GET\u548cPOST\u53c2\u6570\u7684\u4f20\u9001\u6e20\u9053\uff08url\u8fd8\u662frequrest body\uff09\u63d0\u51fa\u4e86\u8981\u6c42\u3002\u201c\u6807\u51c6\u7b54\u6848\u201d\u91cc\u5173\u4e8e\u53c2\u6570\u5927\u5c0f\u7684\u9650\u5236\u53c8\u662f\u4ece\u54ea\u6765\u7684\u5462\uff1f<\/p>\n \u597d\u4e86\uff0c\u73b0\u5728\u4f60\u77e5\u9053\uff0cGET\u548cPOST\u672c\u8d28\u4e0a\u5c31\u662fTCP\u94fe\u63a5\uff0c\u5e76\u65e0\u5dee\u522b\u3002\u4f46\u662f\u7531\u4e8eHTTP\u7684\u89c4\u5b9a\u548c\u6d4f\u89c8\u5668\/\u670d\u52a1\u5668\u7684\u9650\u5236\uff0c\u5bfc\u81f4\u4ed6\u4eec\u5728\u5e94\u7528\u8fc7\u7a0b\u4e2d\u4f53\u73b0\u51fa\u4e00\u4e9b\u4e0d\u540c\u3002<\/p>\n \u4f60\u4ee5\u4e3a\u672c\u6587\u5c31\u8fd9\u4e48\u7ed3\u675f\u4e86\uff1f<\/p>\n<\/a><\/p>\n
\nGET\u4ea7\u751f\u7684URL\u5730\u5740\u53ef\u4ee5\u88abBookmark\uff0c\u800cPOST\u4e0d\u53ef\u4ee5\u3002
\nGET\u8bf7\u6c42\u4f1a\u88ab\u6d4f\u89c8\u5668\u4e3b\u52a8cache\uff0c\u800cPOST\u4e0d\u4f1a\uff0c\u9664\u975e\u624b\u52a8\u8bbe\u7f6e\u3002
\nGET\u8bf7\u6c42\u53ea\u80fd\u8fdb\u884curl\u7f16\u7801\uff0c\u800cPOST\u652f\u6301\u591a\u79cd\u7f16\u7801\u65b9\u5f0f\u3002
\nGET\u8bf7\u6c42\u53c2\u6570\u4f1a\u88ab\u5b8c\u6574\u4fdd\u7559\u5728\u6d4f\u89c8\u5668\u5386\u53f2\u8bb0\u5f55\u91cc\uff0c\u800cPOST\u4e2d\u7684\u53c2\u6570\u4e0d\u4f1a\u88ab\u4fdd\u7559\u3002
\nGET\u8bf7\u6c42\u5728URL\u4e2d\u4f20\u9001\u7684\u53c2\u6570\u662f\u6709\u957f\u5ea6\u9650\u5236\u7684\uff0c\u800cPOST\u4e48\u6709\u3002
\n\u5bf9\u53c2\u6570\u7684\u6570\u636e\u7c7b\u578b\uff0cGET\u53ea\u63a5\u53d7ASCII\u5b57\u7b26\uff0c\u800cPOST\u6ca1\u6709\u9650\u5236\u3002
\nGET\u6bd4POST\u66f4\u4e0d\u5b89\u5168\uff0c\u56e0\u4e3a\u53c2\u6570\u76f4\u63a5\u66b4\u9732\u5728URL\u4e0a\uff0c\u6240\u4ee5\u4e0d\u80fd\u7528\u6765\u4f20\u9012\u654f\u611f\u4fe1\u606f\u3002
\nGET\u53c2\u6570\u901a\u8fc7URL\u4f20\u9012\uff0cPOST\u653e\u5728Request body\u4e2d\u3002<\/p>\n<\/a><\/p>\n
<\/a><\/p>\n
<\/a><\/p>\n
<\/a>
\n\u5728\u6211\u5927\u4e07\u7ef4\u7f51\u4e16\u754c\u4e2d\uff0c\u8fd8\u6709\u53e6\u4e00\u4e2a\u91cd\u8981\u7684\u89d2\u8272\uff1a\u8fd0\u8f93\u516c\u53f8\u3002\u4e0d\u540c\u7684\u6d4f\u89c8\u5668\uff08\u53d1\u8d77http\u8bf7\u6c42\uff09\u548c\u670d\u52a1\u5668\uff08\u63a5\u53d7http\u8bf7\u6c42\uff09\u5c31\u662f\u4e0d\u540c\u7684\u8fd0\u8f93\u516c\u53f8\u3002 \u867d\u7136\u7406\u8bba\u4e0a\uff0c\u4f60\u53ef\u4ee5\u5728\u8f66\u9876\u4e0a\u65e0\u9650\u7684\u5806\u8d27\u7269\uff08url\u4e2d\u65e0\u9650\u52a0\u53c2\u6570\uff09\u3002\u4f46\u662f\u8fd0\u8f93\u516c\u53f8\u53ef\u4e0d\u50bb\uff0c\u88c5\u8d27\u548c\u5378\u8d27\u4e5f\u662f\u6709\u5f88\u5927\u6210\u672c\u7684\uff0c\u4ed6\u4eec\u4f1a\u9650\u5236\u5355\u6b21\u8fd0\u8f93\u91cf\u6765\u63a7\u5236\u98ce\u9669\uff0c\u6570\u636e\u91cf\u592a\u5927\u5bf9\u6d4f\u89c8\u5668\u548c\u670d\u52a1\u5668\u90fd\u662f\u5f88\u5927\u8d1f\u62c5\u3002\u4e1a\u754c\u4e0d\u6210\u6587\u7684\u89c4\u5b9a\u662f\uff0c\uff08\u5927\u591a\u6570\uff09\u6d4f\u89c8\u5668\u901a\u5e38\u90fd\u4f1a\u9650\u5236url\u957f\u5ea6\u57282K\u4e2a\u5b57\u8282\uff0c\u800c\uff08\u5927\u591a\u6570\uff09\u670d\u52a1\u5668\u6700\u591a\u5904\u740664K\u5927\u5c0f\u7684url\u3002\u8d85\u8fc7\u7684\u90e8\u5206\uff0c\u6055\u4e0d\u5904\u7406\u3002\u5982\u679c\u4f60\u7528GET\u670d\u52a1\uff0c\u5728request body\u5077\u5077\u85cf\u4e86\u6570\u636e\uff0c\u4e0d\u540c\u670d\u52a1\u5668\u7684\u5904\u7406\u65b9\u5f0f\u4e5f\u662f\u4e0d\u540c\u7684\uff0c\u6709\u4e9b\u670d\u52a1\u5668\u4f1a\u5e2e\u4f60\u5378\u8d27\uff0c\u8bfb\u51fa\u6570\u636e\uff0c\u6709\u4e9b\u670d\u52a1\u5668\u76f4\u63a5\u5ffd\u7565\uff0c\u6240\u4ee5\uff0c\u867d\u7136GET\u53ef\u4ee5\u5e26request body\uff0c\u4e5f\u4e0d\u80fd\u4fdd\u8bc1\u4e00\u5b9a\u80fd\u88ab\u63a5\u6536\u5230\u54e6\u3002<\/p>\n