{"id":97116,"date":"2024-10-25T11:56:24","date_gmt":"2024-10-25T03:56:24","guid":{"rendered":"https:\/\/www.073980.com\/?p=97116"},"modified":"2024-10-26T09:49:47","modified_gmt":"2024-10-26T01:49:47","slug":"api%e6%98%af%e4%bb%80%e4%b9%88%e6%84%8f%e6%80%9d%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.073980.com\/97116.htm","title":{"rendered":"API\u662f\u4ec0\u4e48\u610f\u601d\uff1f"},"content":{"rendered":"\n

\u5728\u5f53\u4eca\u8fd9\u4e2a\u6570\u5b57\u5316\u7684\u65f6\u4ee3\uff0c\u65e0\u8bba\u662f\u667a\u80fd\u624b\u673a\u4e0a\u7684\u5404\u79cd\u5e94\u7528\uff0c\u8fd8\u662f\u4f01\u4e1a\u7ea7\u7684\u8f6f\u4ef6\u7cfb\u7edf\uff0c\u90fd\u79bb\u4e0d\u5f00\u4e00\u4e2a\u5173\u952e\u6280\u672f\u2014\u2014API(Application Programming Interface\uff0c\u5e94\u7528\u7a0b\u5e8f\u63a5\u53e3)\u3002API\u4f5c\u4e3a\u4e00\u79cd\u9884\u5148\u5b9a\u4e49\u7684\u51fd\u6570\u548c\u7ea6\u5b9a\uff0c\u626e\u6f14\u7740\u8f6f\u4ef6\u7cfb\u7edf\u4e0d\u540c\u7ec4\u6210\u90e8\u5206\u4e4b\u95f4\u8854\u63a5\u7684\u91cd\u8981\u89d2\u8272\u3002<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

\u7b80\u4ecb<\/h2>\n\n\n\n

API\uff0c\u5168\u79f0Application Programming Interface\uff0c\u5373\u5e94\u7528\u7a0b\u5e8f\u63a5\u53e3\uff0c\u662f\u4e00\u79cd\u9884\u5148\u5b9a\u4e49\u7684\u51fd\u6570\u548c\u534f\u8bae\u96c6\uff0c\u7528\u4e8e\u5b9e\u73b0\u4e0d\u540c\u8f6f\u4ef6\u7cfb\u7edf\u6216\u7ec4\u4ef6\u4e4b\u95f4\u7684\u901a\u4fe1\u548c\u6570\u636e\u4ea4\u6362\u3002\u7b80\u5355\u6765\u8bf4\uff0cAPI\u5c31\u50cf\u4e00\u5ea7\u6865\u6881\uff0c\u8fde\u63a5\u7740\u4e0d\u540c\u7684\u8f6f\u4ef6\u670d\u52a1\uff0c\u4f7f\u5b83\u4eec\u80fd\u591f\u76f8\u4e92\u534f\u4f5c\uff0c\u5171\u540c\u5b8c\u6210\u4efb\u52a1\u3002<\/p>\n\n\n\n

\u5206\u7c7b<\/h2>\n\n\n\n

API\u6839\u636e\u5176\u7528\u9014\u548c\u5b9e\u73b0\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5206\u4e3a\u591a\u79cd\u7c7b\u578b\u3002\u6700\u5e38\u89c1\u7684\u5206\u7c7b\u65b9\u5f0f\u5305\u62ec\uff1a<\/p>\n\n\n\n

RESTful API<\/strong>\uff1a\u57fa\u4e8eHTTP\u534f\u8bae\uff0c\u4f7f\u7528URL\u8def\u5f84\u548cHTTP\u65b9\u6cd5(\u5982GET\u3001POST\u3001PUT\u3001DELETE)\u6765\u64cd\u4f5c\u8d44\u6e90\u3002RESTful API\u56e0\u5176\u7b80\u5355\u3001\u7075\u6d3b\u548c\u6613\u4e8e\u96c6\u6210\u7684\u7279\u70b9\uff0c\u6210\u4e3a\u5f53\u524d\u6700\u6d41\u884c\u7684API\u7c7b\u578b\u4e4b\u4e00\u3002<\/p>\n\n\n\n

SOAP API<\/strong>\uff1a\u57fa\u4e8eXML\u683c\u5f0f\u7684\u6d88\u606f\u4f20\u9012\u534f\u8bae\uff0c\u5e38\u7528\u4e8e\u4f01\u4e1a\u7ea7\u5e94\u7528\u4e4b\u95f4\u7684\u901a\u4fe1\u3002SOAP API\u63d0\u4f9b\u4e86\u66f4\u590d\u6742\u7684\u7ed3\u6784\u548c\u5b89\u5168\u6027\uff0c\u4f46\u76f8\u5e94\u5730\uff0c\u5176\u5b9e\u73b0\u548c\u96c6\u6210\u6210\u672c\u4e5f\u66f4\u9ad8\u3002<\/p>\n\n\n\n

GraphQL API<\/strong>\uff1a\u4e00\u79cd\u7528\u4e8eAPI\u7684\u67e5\u8be2\u8bed\u8a00\uff0c\u5141\u8bb8\u5ba2\u6237\u7aef\u8bf7\u6c42\u5b83\u6240\u9700\u7684\u786e\u5207\u6570\u636e\uff0c\u800c\u4e0d\u662f\u50cfRESTful API\u90a3\u6837\u8fd4\u56de\u6574\u4e2a\u8d44\u6e90\u5bf9\u8c61\u3002GraphQL API\u5728\u6570\u636e\u83b7\u53d6\u6548\u7387\u548c\u7075\u6d3b\u6027\u65b9\u9762\u5177\u6709\u663e\u8457\u4f18\u52bf\u3002<\/p>\n\n\n\n

WebSocket API<\/strong>\uff1a\u5b9e\u73b0\u53cc\u5411\u5b9e\u65f6\u901a\u4fe1\u7684API\uff0c\u5e38\u7528\u4e8e\u9700\u8981\u5373\u65f6\u54cd\u5e94\u7684\u5e94\u7528\u573a\u666f\uff0c\u5982\u804a\u5929\u5e94\u7528\u3001\u5b9e\u65f6\u6570\u636e\u63a8\u9001\u7b49\u3002<\/p>\n\n\n\n

API\u58f0\u660e<\/h2>\n\n\n\n

API\u7684\u58f0\u660e\u901a\u5e38\u5305\u62ec\u5176\u529f\u80fd\u63cf\u8ff0\u3001\u8bf7\u6c42\u65b9\u5f0f\u3001\u8bf7\u6c42\u53c2\u6570\u3001\u54cd\u5e94\u683c\u5f0f\u7b49\u5173\u952e\u4fe1\u606f\u3002\u8fd9\u4e9b\u58f0\u660e\u901a\u5e38\u901a\u8fc7API\u6587\u6863\u6216API\u95e8\u6237\u5411\u5f00\u53d1\u8005\u63d0\u4f9b\u3002\u6839\u636e\u4e00\u9879\u9488\u5bf9\u5168\u7403\u5f00\u53d1\u8005\u7684\u8c03\u67e5\uff0c\u8d85\u8fc780%\u7684\u5f00\u53d1\u8005\u8868\u793a\uff0cAPI\u6587\u6863\u7684\u6e05\u6670\u5ea6\u548c\u5b8c\u6574\u6027\u662f\u4ed6\u4eec\u9009\u62e9\u4f7f\u7528\u67d0\u4e2aAPI\u7684\u91cd\u8981\u56e0\u7d20\u4e4b\u4e00\u3002<\/p>\n\n\n\n

\u5e38\u89c1\u95ee\u9898<\/h2>\n\n\n\n

\u5c3d\u7ba1API\u5728\u8f6f\u4ef6\u5f00\u53d1\u548c\u6570\u636e\u96c6\u6210\u4e2d\u626e\u6f14\u7740\u91cd\u8981\u89d2\u8272\uff0c\u4f46\u5f00\u53d1\u8005\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u4e5f\u5e38\u4f1a\u9047\u5230\u4e00\u4e9b\u95ee\u9898\u3002\u4f8b\u5982\uff0cAPI\u7684\u8bbf\u95ee\u9650\u5236(\u5982\u901f\u7387\u9650\u5236\u3001IP\u767d\u540d\u5355\u7b49)\u3001API\u7684\u517c\u5bb9\u6027\u95ee\u9898(\u4e0d\u540c\u7248\u672c\u4e4b\u95f4\u7684\u5dee\u5f02)\u3001API\u7684\u5b89\u5168\u6027\u95ee\u9898(\u5982\u6570\u636e\u6cc4\u9732\u3001\u672a\u6388\u6743\u8bbf\u95ee\u7b49)\u7b49\u3002\u8fd9\u4e9b\u95ee\u9898\u9700\u8981\u5f00\u53d1\u8005\u5728\u4f7f\u7528API\u65f6\u7ed9\u4e88\u8db3\u591f\u7684\u5173\u6ce8\u548c\u5904\u7406\u3002<\/p>\n\n\n\n

\u7a0b\u5e8f\u529f\u80fd<\/h2>\n\n\n\n

API\u7684\u529f\u80fd\u662f\u591a\u79cd\u591a\u6837\u7684\uff0c\u5b83\u4eec\u53ef\u4ee5\u7528\u4e8e\u5b9e\u73b0\u6570\u636e\u7684\u83b7\u53d6\u548c\u5b58\u50a8\u3001\u7528\u6237\u8ba4\u8bc1\u548c\u6388\u6743\u3001\u6d88\u606f\u7684\u53d1\u9001\u548c\u63a5\u6536\u7b49\u3002\u4ee5\u793e\u4ea4\u5a92\u4f53\u5e73\u53f0\u4e3a\u4f8b\uff0c\u5176\u63d0\u4f9b\u7684API\u5141\u8bb8\u7b2c\u4e09\u65b9\u5f00\u53d1\u8005\u5728\u5e73\u53f0\u4e0a\u521b\u5efa\u5e94\u7528\u7a0b\u5e8f\uff0c\u5b9e\u73b0\u7528\u6237\u6570\u636e\u7684\u540c\u6b65\u3001\u5185\u5bb9\u7684\u53d1\u5e03\u548c\u5206\u4eab\u7b49\u529f\u80fd\u3002\u8fd9\u4e9b\u529f\u80fd\u4e0d\u4ec5\u4e30\u5bcc\u4e86\u793e\u4ea4\u5a92\u4f53\u5e73\u53f0\u7684\u4f7f\u7528\u573a\u666f\uff0c\u4e5f\u4e3a\u7b2c\u4e09\u65b9\u5f00\u53d1\u8005\u5e26\u6765\u4e86\u5546\u4e1a\u673a\u4f1a\u3002<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

API\u4e0eGUI<\/h2>\n\n\n\n

API\u4e0eGUI(\u56fe\u5f62\u7528\u6237\u754c\u9762)\u662f\u8f6f\u4ef6\u5f00\u53d1\u4e2d\u4e24\u4e2a\u4e0d\u53ef\u6216\u7f3a\u7684\u90e8\u5206\u3002API\u8d1f\u8d23\u8f6f\u4ef6\u5185\u90e8\u7684\u903b\u8f91\u5904\u7406\u548c\u6570\u636e\u4ea4\u6362\uff0c\u800cGUI\u5219\u8d1f\u8d23\u4e0e\u7528\u6237\u8fdb\u884c\u4ea4\u4e92\uff0c\u5c55\u793a\u4fe1\u606f\u548c\u63a5\u6536\u7528\u6237\u8f93\u5165\u3002\u4e24\u8005\u76f8\u8f85\u76f8\u6210\uff0c\u5171\u540c\u6784\u6210\u4e86\u5b8c\u6574\u7684\u8f6f\u4ef6\u7cfb\u7edf\u3002<\/p>\n\n\n\n

\u4ee5\u667a\u80fd\u624b\u673a\u4e3a\u4f8b\uff0c\u5176\u64cd\u4f5c\u7cfb\u7edf\u63d0\u4f9b\u7684API\u5141\u8bb8\u5f00\u53d1\u8005\u521b\u5efa\u5404\u79cd\u5e94\u7528\u7a0b\u5e8f\uff0c\u8fd9\u4e9b\u5e94\u7528\u7a0b\u5e8f\u901a\u8fc7GUI\u4e0e\u7528\u6237\u8fdb\u884c\u4ea4\u4e92\uff0c\u5b9e\u73b0\u5404\u79cd\u529f\u80fd\u3002\u5982\u679c\u6ca1\u6709API\u7684\u652f\u6301\uff0c\u5f00\u53d1\u8005\u5c06\u65e0\u6cd5\u8bbf\u95ee\u64cd\u4f5c\u7cfb\u7edf\u7684\u5e95\u5c42\u529f\u80fd\uff0c\u4e5f\u65e0\u6cd5\u5b9e\u73b0\u590d\u6742\u7684\u7528\u6237\u4ea4\u4e92\u3002<\/p>\n\n\n\n

\u603b\u4e4b\uff0cAPI\u4e0d\u4ec5\u662f\u6280\u672f\u53d1\u5c55\u7684\u4ea7\u7269\uff0c\u66f4\u662f\u63a8\u52a8\u6280\u672f\u8fdb\u6b65\u7684\u91cd\u8981\u529b\u91cf\u3002\u5728\u672a\u6765\uff0c\u6211\u4eec\u6709\u7406\u7531\u76f8\u4fe1\uff0cAPI\u5c06\u7ee7\u7eed\u5728\u6570\u5b57\u5316\u4e16\u754c\u4e2d\u53d1\u6325\u66f4\u52a0\u91cd\u8981\u7684\u4f5c\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728\u5f53\u4eca\u8fd9\u4e2a\u6570\u5b57\u5316\u7684\u65f6\u4ee3\uff0c\u65e0\u8bba\u662f\u667a\u80fd\u624b\u673a\u4e0a\u7684\u5404\u79cd\u5e94\u7528\uff0c\u8fd8\u662f\u4f01\u4e1a\u7ea7\u7684\u8f6f\u4ef6\u7cfb\u7edf\uff0c\u90fd\u79bb\u4e0d\u5f00\u4e00\u4e2a\u5173\u952e\u6280\u672f\u2014\u2014API(Application Programming Interface\uff0c\u5e94\u7528\u7a0b\u5e8f\u63a5\u53e3)\u3002API\u4f5c\u4e3a\u4e00\u79cd\u9884\u5148\u5b9a\u4e49\u7684\u51fd\u6570\u548c\u7ea6\u5b9a\uff0c\u626e\u6f14\u7740\u8f6f\u4ef6\u7cfb\u7edf…<\/p>\n","protected":false},"author":422,"featured_media":97117,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9192,9191],"tags":[],"topic":[],"class_list":["post-97116","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shuyu","category-baike"],"_links":{"self":[{"href":"https:\/\/www.073980.com\/wp-json\/wp\/v2\/posts\/97116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.073980.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.073980.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.073980.com\/wp-json\/wp\/v2\/users\/422"}],"replies":[{"embeddable":true,"href":"https:\/\/www.073980.com\/wp-json\/wp\/v2\/comments?post=97116"}],"version-history":[{"count":1,"href":"https:\/\/www.073980.com\/wp-json\/wp\/v2\/posts\/97116\/revisions"}],"predecessor-version":[{"id":97119,"href":"https:\/\/www.073980.com\/wp-json\/wp\/v2\/posts\/97116\/revisions\/97119"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.073980.com\/wp-json\/wp\/v2\/media\/97117"}],"wp:attachment":[{"href":"https:\/\/www.073980.com\/wp-json\/wp\/v2\/media?parent=97116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.073980.com\/wp-json\/wp\/v2\/categories?post=97116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.073980.com\/wp-json\/wp\/v2\/tags?post=97116"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.073980.com\/wp-json\/wp\/v2\/topic?post=97116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}