{"id":569,"date":"2023-12-08T12:10:07","date_gmt":"2023-12-08T04:10:07","guid":{"rendered":"https:\/\/abstreamace.com\/sglab\/?p=569"},"modified":"2023-12-08T12:11:10","modified_gmt":"2023-12-08T04:11:10","slug":"%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85","status":"publish","type":"post","link":"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/","title":{"rendered":"\u7db2\u8def API \u67b6\u69cb\u61f6\u4eba\u5305"},"content":{"rendered":"<p>API\uff08Application Programming Interface\uff0c\u61c9\u7528\u7a0b\u5f0f\u4ecb\u9762\uff09\u5927\u5bb6\u90fd\u5728\u7528\uff0c\u4e00\u4e9b\u67b6\u69cb\u8853\u8a9e\u50cf\u662f RPC\u3001REST\u3001GraphQL \u7b49\u7b49\u4e5f\u5e38\u5e38\u807d\u904e\uff0c\u4f46\u662f\u6211\u89ba\u5f97\u7db2\u8def\u4e0a\u7d55\u5927\u90e8\u5206\u7684\u6587\u7ae0\u90fd\u6c92\u6709\u8b1b\u5230\u5b83\u5011\u7684\u91cd\u9ede\u5728\u54ea\u88e1\u3001\u90fd\u662f\u4e00\u76f4\u5728\u91cd\u8907\u8271\u6f80\u4e14\u4e0d\u5bb9\u6613\u9ad4\u6703\u7684\u5b9a\u7fa9\u3002\u5728\u9019\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u60f3\u7528\u6211\u7684\u8996\u89d2\u4f86\u7c21\u55ae\u89e3\u91cb\u4e00\u4e0b\u9019\u4e9b\u67b6\u69cb\u3002<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u5167\u5bb9\u76ee\u9304<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/#RPC\" >RPC<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/#REST\" >REST<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/#GraphQL\" >GraphQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/#%E7%B5%90%E8%AA%9E\" >\u7d50\u8a9e<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"RPC\"><\/span>RPC<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u5927\u90e8\u5206\u5728\u8ac7 API \u67b6\u69cb\u6bd4\u8f03\u7684\u6587\u7ae0\u90fd\u6703\u653e\u4e0a\u9019\u4e00\u5f35\u6642\u9593\u8ef8\u7684\u5716\uff0c\u6240\u4ee5\u9019\u908a\u6211\u4e5f\u7a0d\u5fae\u501f\u4f86\u7528\u4e00\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/abstreamace.com\/sglab\/wp-content\/uploads\/2023\/12\/image-1702000679927.png\" alt=\"file\" \/><\/p>\n<p>\u5176\u4e2d CORBA\uff08Common Object Request Broker Architecture\uff09\u548c RDA\uff08Remote Data Access\uff09\u7684\u6982\u5ff5\u8ddf\u6211\u5011\u73fe\u5728\u5fc3\u4e2d\u60f3\u50cf\u7684\u300cAPI\u300d\u6982\u5ff5\u5dee\u8ddd\u6bd4\u8f03\u5927\u4e00\u9ede\uff0c\u6240\u4ee5\u4e0d\u592a\u9700\u8981\u591a\u8ac7\u3002SOAP\uff08Simple Object Access Protocol\uff09\u4e26\u6c92\u6709\u592a\u6d41\u884c\uff0c\u6240\u4ee5\u5404\u4f4d\u4e5f\u4e0d\u7528\u7ba1\u3002OData\uff08Open Data Protocol\uff09\u53ea\u662f REST \u7684\u4e00\u7a2e\u5be6\u4f5c\uff0c\u9019\u908a\u4e5f\u4e0d\u591a\u63d0\u7d30\u7bc0\u3002\u9019\u4e9b\u6771\u897f\u7a0d\u5fae\u77e5\u9053\u4e00\u4e0b\u6709\u9019\u9ebc\u4e00\u56de\u4e8b\u5c31\u597d\u3002<\/p>\n<p>\u5728\u6211\u5011\u4eca\u5929\u6703\u8b1b\u5230\u7684\u5e7e\u7a2e\u4e3b\u8981\u7684 API \u67b6\u69cb\u7576\u4e2d\uff0c\u6700\u65e9\u51fa\u73fe\u7684\u7576\u5c6c RPC\uff08Remote Procedure Call\uff0c\u9060\u7aef\u7a0b\u5e8f\u547c\u53eb\uff09\uff0c\u5b83\u751a\u81f3\u53ef\u4ee5\u8ffd\u6eaf\u5230\u6bd4\u4e0a\u9762\u9019\u5f35\u5716\u756b\u51fa\u4f86\u7684\u5e74\u4ee3\u9084\u66f4\u65e9\u3002\u7136\u800c\uff0c\u5f9e\u6211\u9019\u500b\u6578\u5b78\u80cc\u666f\u4f86\u89d2\u5ea6\u4f86\u770b\uff0c\u7db2\u8def\u4e0a\u7684\u8cc7\u6599\u5c0d\u65bc RPC \u9019\u5247\u8853\u8a9e\u662f\u5f88\u7f3a\u4e4f\u4e00\u500b\u7d71\u4e00\u7684\u5b9a\u7fa9\u7684\uff0c\u6709\u7684\u6642\u5019\u4eba\u5011\u5f88\u72f9\u7fa9\u5730\u4f7f\u7528\u9019\u500b\u8853\u8a9e\u3001\u4f46\u6709\u6642\u53c8\u5f88\u5ee3\u7fa9\uff0c\u6240\u4ee5\u70ba\u4e86\u907f\u514d\u9020\u6210\u56f0\u60d1\uff0c\u5e95\u4e0b\u5169\u65b9\u9762\u6211\u90fd\u6703\u8b1b\u3002<\/p>\n<p>\u5c31\u5b57\u9762\u4e0a\u4f86\u8aaa\uff0cRPC \u7684\u610f\u601d\u5c31\u662f\u300c\u60f3\u50cf\u6211\u5011\u76f4\u63a5\u547c\u53eb\u9060\u7aef\u61c9\u7528\u7a0b\u5f0f\u4e0a\u9762\u5b9a\u7fa9\u7684\u51fd\u6578\u6216\u65b9\u6cd5\u300d\u3002\u771f\u6b63\u72f9\u7fa9\u800c\u8a00\uff0cRPC \u7684 API \u61c9\u8a72\u8981\u6709\u9019\u6a23\u7684\u6027\u8cea\uff1a<\/p>\n<ol>\n<li>\u57fa\u672c\u4e0a\u53ea\u6709\u4e00\u500b API \u7aef\u9ede\uff08\u4e5f\u5c31\u662f API \u7684\u7db2\u5740\uff09\u3002<\/li>\n<li>\u5728\u9001\u904e\u53bb\u7684\u8acb\u6c42\uff08\u683c\u5f0f\u4e0d\u4e00\u5b9a\uff0c\u5f9e\u800c\u884d\u751f\u51fa\u4e86 XML-RPC\u3001JSON-RPC \u548c gRPC \u9019\u4e9b\u8b8a\u7a2e\uff09\u7576\u4e2d\uff0c\u6703\u660e\u78ba\u6307\u51fa\u6211\u5011\u8981\u4f7f\u7528\u7684\u9060\u7aef\u65b9\u6cd5\u4e4b\u540d\u7a31\uff0c\u85c9\u6b64\u5340\u5206\u6211\u5011\u60f3\u8981\u4f7f\u7528\u7684\u529f\u80fd\u3002<\/li>\n<li>\u7136\u5f8c\u5728\u8acb\u6c42\u7684\u5f8c\u534a\u6bb5\u6703\u662f\u6211\u5011\u8981\u50b3\u5165\u7d66\u9060\u7aef\u65b9\u6cd5\u7684\u53c3\u6578\u6216\u8cc7\u6599\u3002<\/li>\n<\/ol>\n<p>\u8036\uff0c\u53ef\u662f\uff0c\u4e5f\u8a31\u662f\u6211\u898b\u8b58\u5c11\u5566\uff0c\u5728\u4eca\u5929\u3001\u9019\u9ebc\u72f9\u7fa9\u7684 RPC API \u6211\u9084\u771f\u7684\u6c92\u770b\u904e\u591a\u5c11\u3002\u53d6\u800c\u4ee3\u4e4b\u5730\uff0c\u6bd4\u8f03\u591a\u7684 API \u6703\u662f\u7528\u4e0d\u540c\u7684\u7aef\u9ede\u4f86\u5340\u5206\u4e0d\u540c\u7684\u529f\u80fd\u3001\u7136\u5f8c\u8acb\u6c42\u7684\u5167\u5bb9\u6574\u500b\u5c31\u662f\u8981\u50b3\u5165\u7684\u53c3\u6578\u6216\u8cc7\u6599\u3002\u50cf\u9019\u6a23\u7684 API \u6211\u5011\u53ef\u4ee5\u8aaa\u5b83\u662f\u4e00\u7a2e\u6bd4\u8f03\u5ee3\u7fa9\u7684 RPC API\uff1b\u96d6\u7136\u5176\u5f62\u5f0f\u4e26\u975e\u56b4\u683c\u610f\u7fa9\u4e0a\u7684 JSON-RPC\uff08\u4f8b\u5982\u5566\uff09\uff0c\u4f46\u662f\u7cbe\u795e\u5176\u5be6\u662f\u5dee\u4e0d\u591a\u7684\uff0c\u90fd\u662f\u74b0\u7e5e\u8457\u4e00\u500b\u6838\u5fc3\u60f3\u6cd5\uff1a<\/p>\n<div class=\"card mb-3 text-white\">\n<div class=\"card-body\">\n    \u5ee3\u7fa9\u7684 RPC API\uff0c\u91cd\u9ede\u5728\u65bc\u500b\u5225\u7684\u300c\u529f\u80fd\u300d\u662f\u6253\u5305\u597d\u7684\uff0c\u4e5f\u5c31\u662f\u529f\u80fd\u5c0e\u5411\u3001\u662f\u9ad8\u968e\u7684 API\u3002\n    <\/div>\n<\/div>\n<p>\u800c\u7576\u7db2\u8def\u4e0a\u7684\u6587\u7ae0\u5728\u8b1b\u300cRPC vs REST\u300d\u4e4b\u9593\u7684\u5c0d\u6bd4\u6642\uff0c\u901a\u5e38\u90a3\u500b\u4f5c\u8005\u662f\u5728\u6307\u9019\u7a2e\u5ee3\u7fa9\u7684 RPC\uff0c\u800c\u4e0d\u50c5\u9650\u65bc\u72f9\u7fa9\u4e0a\u7684\u3002<\/p>\n<p>\u9019\u500b\u6838\u5fc3\u60f3\u6cd5\u662f\u4e00\u500b\u5169\u9762\u5203\u3002\u4e00\u65b9\u9762\uff0c\u529f\u80fd\u5c0e\u5411\u610f\u5473\u8457\u524d\u7aef\u53ef\u4ee5\u7528\u6700\u7cbe\u7c21\u7684\u65b9\u5f0f\u4e0b\u9054\u8acb\u6c42\u3001\u4e26\u4e14\u6536\u5230\u5b8c\u5168\u7b26\u5408\u9700\u6c42\u7684\u56de\u61c9\uff0c\u4e0d\u591a\u4e5f\u4e0d\u5c11\uff1b\u4f46\u662f\u53e6\u5916\u4e00\u65b9\u9762\uff0c\u529f\u80fd\u5c0e\u5411\u4e5f\u610f\u5473\u8457\u524d\u7aef\u8ddf\u5f8c\u7aef\u662f\u5f37\u8026\u5408\u7684\u3002\u4ec0\u9ebc\u610f\u601d\u5462\uff1f\u5c31\u662f\u5047\u5982\u4eca\u5929\u524d\u7aef\u6709\u65b0\u7684\u529f\u80fd\u9700\u6c42\u662f\u65e2\u6709\u7684 API \u7121\u6cd5\u6eff\u8db3\u7684\uff0c\u90a3\u9ebc\u4e00\u5b9a\u5f97\u627e\u8ca0\u8cac\u5f8c\u7aef\u7684\u5718\u968a\u4f86\u4fee\u6539\u3001\u6216\u8005\u958b\u51fa\u65b0\u7684 API \u4f86\u6eff\u8db3\u65b0\u7684\u9700\u6c42\u3002\u5982\u6b64\u4e00\u4f86\uff0c\u524d\u5f8c\u7aef\u5c31\u6c92\u8fa6\u6cd5\u5404\u81ea\u7368\u7acb\u958b\u767c\u3001\u800c\u9700\u8981\u5bc6\u5207\u914d\u5408\uff1b\u5f8c\u7aef\u9700\u8981\u5f88\u6e05\u695a\u524d\u7aef\u9700\u8981\u4ec0\u9ebc\u529f\u80fd\uff0c\u524d\u7aef\u4e5f\u9700\u8981\u5f88\u6e05\u695a\u5f8c\u7aef\u958b\u51fa\u4f86\u7684 API \u898f\u683c\u662f\u4ec0\u9ebc\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"REST\"><\/span>REST<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u800c REST\uff08REpresentational State Transfer\uff0c\u8868\u73fe\u5c64\u72c0\u614b\u8f49\u63db\uff09\u7684\u6838\u5fc3\u6982\u5ff5\u53ef\u4ee5\u8aaa\u5c31\u662f\u70ba\u4e86\u89e3\u6c7a\u9019\u7a2e\u8026\u5408\u800c\u8a95\u751f\u7684\u3002\u7576\u7136\uff0c\u5982\u679c\u53bb\u770b\u7db2\u8def\u4e0a\u7684\u5b9a\u7fa9\uff0c\u5b83\u9084\u6709\u4e00\u5927\u5806\u66f4\u52a0\u6839\u672c\u7684\u5b9a\u7fa9\uff0c\u50cf\u662f\u5229\u7528 HTTP \u65b9\u6cd5\uff08GET\u3001POST\u3001PUT\u3001DELETE\uff09\u4f86\u63cf\u8ff0\u64cd\u4f5c\u5566\u3001\u901a\u5e38\u662f\u7121\u72c0\u614b\u7684\uff08stateless\uff09\u5566\u2026\u2026\u4f46\u90a3\u4e9b\u90fd\u4e0d\u662f\u91cd\u9ede\uff01\u5b83\u76f8\u8f03\u65bc RPC \u7684\u771f\u6b63\u91cd\u9ede\u5728\u65bc\uff1a<\/p>\n<div class=\"card mb-3 text-white\">\n<div class=\"card-body\">\n    REST \u8457\u773c\u5728\u300c\u8cc7\u6e90\u300d\u7684\u64cd\u4f5c\uff0c\u4e5f\u5c31\u662f\u8cc7\u6e90\u5c0e\u5411\u3001\u662f\u4f4e\u968e\u7684 API\u3002\n    <\/div>\n<\/div>\n<p>\u5443\uff0c\u53ef\u662f\u4ec0\u9ebc\u662f\u8cc7\u6e90\uff1f\u9019\u5c31\u6709\u9ede\u62bd\u8c61\u4e86\uff0c\u4f46\u5177\u9ad4\u4e00\u9ede\u4f86\u8aaa\u7684\u8a71\uff0c\u4e0d\u59a8\u7406\u89e3\u6210\u8cc7\u6599\u5eab\u88e1\u9762\u7684\u6bcf\u4e00\u7a2e\u8cc7\u6599\u8868\u90fd\u662f\u4e00\u7a2e\u8cc7\u6e90\u5c31\u597d\u3002\u65bc\u662f RESTful API\uff08\u52a0\u4e0a\u90a3\u500b\u300cful\u300d\u53ea\u662f\u82f1\u6587\u6587\u6cd5\u7684\u554f\u984c\u800c\u5df2\uff0c\u9084\u662f\u540c\u4e00\u56de\u4e8b\uff09\u5c31\u6703\u7528\u500b\u5225\u7684\u7aef\u9ede\u4f86\u5c0d\u61c9\u5404\u7a2e\u8cc7\u6e90\uff0c\u7136\u5f8c\u524d\u7aef\u5c31\u53ef\u4ee5\u7528 GET \u7b49\u65b9\u6cd5\u53bb\u64cd\u4f5c\u5c0d\u61c9\u8cc7\u6e90\u7684 CRUD\uff08\u589e\u67e5\u6539\u522a\uff09\u52d5\u4f5c\u3002<\/p>\n<p>\u8036\uff0c\u7b49\u4e00\u4e0b\uff0c\u90a3\u4e0d\u5c31\u7b49\u65bc\u662f\u76f4\u63a5\u628a\u8cc7\u6599\u5eab\u7684\u64cd\u4f5c\u66dd\u5149\u7d66\u524d\u7aef\u4e86\u55ce\uff1f\u76f8\u4fe1\u7b2c\u4e00\u6b21\u5b78\u5230 REST \u7684\u4eba\u61c9\u8a72\u5f88\u591a\u90fd\u6703\u6709\u9019\u500b\u7591\u60d1\u3002\u55ef\uff0c\u662f\u5566\uff0c\u5f88\u5927\u7684\u6210\u4efd\u4e0a\u4f86\u8aaa\u5c31\u662f\u9019\u6a23\u6c92\u932f\uff0c\u4f46\u662f\u4e5f\u6c92\u6709\u5230 100% \u66dd\u5149\u8cc7\u6599\u5eab\u7684\u5730\u6b65\uff0c\u56e0\u70ba\u5f8c\u7aef\u9084\u662f\u6703\u5728\u4e2d\u9593\u505a\u4e00\u9053\u628a\u95dc\u7684\u52d5\u4f5c\uff0c\u4f8b\u5982\u6703\u53bb\u6aa2\u67e5 API \u50b3\u904e\u4f86\u7684 token\u3001\u770b\u770b\u6253 API \u7684\u4eba\u662f\u5426\u6709\u5c0d\u61c9\u8cc7\u6e90\u7684\u5b58\u53d6\u6b0a\uff0c\u4ee5\u53ca\u78ba\u4fdd\u5beb\u5165\u7684\u8cc7\u6599\u683c\u5f0f\u6b63\u78ba\u7b49\u7b49\u7684\u3002<\/p>\n<p>\u8cc7\u6e90\u5c0e\u5411\u7684\u4f5c\u6cd5\u4e5f\u662f\u6709\u5176\u5229\u5f0a\uff1a\u9996\u5148\uff0c\u5b83\u78ba\u5be6\u5728\u5f88\u5927\u7684\u7a0b\u5ea6\u4e0a\u89e3\u8026\u4e86\u524d\u5f8c\u7aef\u7684\u958b\u767c\uff0c\u56e0\u70ba\u53ea\u8981\u8cc7\u6e90\u7684\u7a2e\u985e\u4e0d\u8b8a\uff0c\u524d\u7aef\u53ef\u4ee5\u81ea\u5df1\u6839\u64da\u5176\u9700\u6c42\u53bb\u62fc\u6e4a\u6488\u51fa\u4f86\u7684\u8cc7\u6599\u7b49\u7b49\uff0c\u4e0d\u6703\u53d7\u9650\u65bc\u5f8c\u7aef\u63d0\u4f9b\u7684\u9ad8\u968e\u529f\u80fd\u3001\u800c\u662f\u53ef\u4ee5\u81ea\u5df1\u7528\u4f4e\u968e\u64cd\u4f5c\u53bb\u7d44\u5408\u51fa\u60f3\u8981\u7684\u9ad8\u968e\u529f\u80fd\u3002\u5176\u6b21\uff0c\u96d6\u7136 REST \u6574\u9ad4\u4f86\u8aaa\u4e26\u6c92\u6709\u7d71\u4e00\u7684\u5be6\u4f5c\u65b9\u5f0f\uff0c\u4f46\u662f\u81f3\u5c11\u5728\u540c\u4e00\u500b\u5c08\u6848\u7576\u4e2d\u3001\u5728\u64cd\u4f5c\u5404\u7a2e\u8cc7\u6e90\u7684\u6642\u5019\u662f\u7d71\u4e00\u7684\uff0c\u524d\u7aef\u958b\u767c\u4eba\u54e1\u5f88\u5bb9\u6613\u8209\u4e00\u53cd\u4e09\u77e5\u9053\u8981\u600e\u9ebc\u4f7f\u7528\u3001\u800c\u4e0d\u7528\u591a\u770b\u5f8c\u7aef\u5718\u968a\u7684\u6587\u4ef6\u3002\u4f46\u662f\u53cd\u904e\u4f86\uff0c\u5b83\u7684\u7f3a\u9ede\u5247\u5305\u62ec\uff1a<\/p>\n<ol>\n<li>\u6bd4\u8f03\u6c92\u6548\u7387\uff1a\u5728\u7528\u4f4e\u968e\u64cd\u4f5c\u53bb\u7d44\u5408\u9ad8\u968e\u529f\u80fd\u7684\u6642\u5019\uff0c\u53ef\u80fd\u6703\u9700\u8981\u6253\u5f88\u591a\u6b21 API \u624d\u7d44\u5f97\u51fa\u60f3\u8981\u7684\u6548\u679c\uff0c\u800c\u4e14\u5176\u4e2d\u53ef\u80fd\u6703\u50b3\u8f38\u4e86\u5f88\u591a\u524d\u7aef\u5176\u5be6\u4e26\u4e0d\u9700\u8981\u7684\u8cc7\u6599\u3002<\/li>\n<li>\u4e0d\u9069\u5408\u727d\u6d89\u5230\u5546\u696d\u908f\u8f2f\u7684\u4ea4\u6613\uff1a\u5982\u679c\u67d0\u4e00\u9805\u9ad8\u968e\u64cd\u4f5c\u5fc5\u9808\u6b63\u78ba\u5730\u7d44\u5408\u82e5\u5e72\u4f4e\u968e\u64cd\u4f5c\u624d\u80fd\u53cd\u61c9\u5546\u696d\u908f\u8f2f\uff0c\u7528 REST \u5c31\u4e0d\u9069\u5408\u4e86\uff0c\u56e0\u70ba\u5b83\u6bd4\u8f03\u96e3\u9632\u7bc4\u5404\u7a2e\u64cd\u4f5c\u4e0a\u7684\u932f\u8aa4\uff08\u5305\u62ec\u4f7f\u7528\u8005\u60e1\u610f\u81ea\u5df1\u6253 API\u3001\u524d\u7aef\u7684\u5546\u696d\u908f\u8f2f\u5be6\u4f5c\u932f\u8aa4\u3001\u6216\u662f\u4f4e\u968e\u64cd\u4f5c\u5230\u4e00\u534a\u7684\u6642\u5019\u7db2\u8def\u65b7\u7dda\u7b49\u7b49\uff1b\u9019\u4e9b\u8981\u9632\u4e0d\u662f\u4e0d\u53ef\u80fd\uff0c\u4f46\u6703\u6bd4\u8f03\u9ebb\u7169\uff09\u3002REST \u6bd4\u8f03\u9069\u5408\u7684\u60c5\u5883\u662f\u55ae\u7d14\u7684\u5167\u5bb9\uff0c\u4f8b\u5982\u8ad6\u58c7\u6216\u793e\u4ea4\u5e73\u53f0\u9019\u7a2e\u5f35\u8cbc\u7684\u5167\u5bb9\u4e4b\u9593\u4e0d\u9700\u8981\u5b58\u5728\u4ec0\u9ebc\u908f\u8f2f\u7684\u6771\u897f\u3002<\/li>\n<\/ol>\n<p>\u6240\u4ee5\u5c0d\u65bc\u8b1b\u7a76\u5546\u696d\u908f\u8f2f\u7684\u529f\u80fd\u4f86\u8aaa\uff0c\u5ee3\u7fa9\u7684 RPC API \u9084\u662f\u6bd4\u8f03\u9069\u5408\u7684\u3002\u7576\u7db2\u8def\u4e0a\u5728\u5c0d\u6bd4\u300cRPC vs REST\u300d\u7684\u6642\u5019\uff0c\u5176\u5be6\u4ed6\u5011\u771f\u7684\u5728\u8b1b\u7684\u662f\u300c\u529f\u80fd\u5c0e\u5411 vs \u8cc7\u6e90\u5c0e\u5411\u300d\u4e4b\u9593\u7684\u5dee\u7570\uff0c\u800c\u4e0d\u662f\u72f9\u7fa9\u7684 RPC \u8ddf REST\u3002\u5c24\u5176\uff0c\u8cc7\u6e90\u5c0e\u5411\u7684 API \u9664\u4e86 REST \u4e4b\u5916\u9084\u6709\u66f4\u65b0\u7684 GraphQL\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"GraphQL\"><\/span>GraphQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>GraphQL \u7c21\u55ae\u4f86\u8aaa\u5c31\u662f\u8981\u89e3\u6c7a REST \u6700\u70ba\u4eba\u8a6c\u75c5\u7684\u50b3\u8f38\u554f\u984c\u3002\u5b83\u900f\u904e\u4e00\u5957\u7368\u7279\u7684\u8a9e\u6cd5\u4f86\u5b9a\u7fa9\u300c\u6211\u5230\u5e95\u60f3\u8981\u4ec0\u9ebc\u6a23\u7684\u8cc7\u6599\u300d\uff0c\u7136\u5f8c\u8b93\u5f8c\u53f0\u6839\u64da\u9019\u500b\u8a9e\u6cd5\u4f86\u7d44\u5408\u51fa\u524d\u7aef\u60f3\u8981\u7684\u8cc7\u6599\u3001\u6216\u662f\u985e\u4f3c\u5730\u9032\u884c\u8cc7\u6599\u7684\u4fee\u6539\u3002\u9664\u6b64\u4e4b\u5916\uff0c\u5b83\u9084\u591a\u4e86\u4e00\u500b\u300c\u8a02\u95b1\u300d\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u8b93\u524d\u7aef\u6301\u7e8c\u8a02\u95b1\u8cc7\u6e90\u7684\u8b8a\u52d5\u3001\u4e26\u4e14\u5728\u8b8a\u52d5\u7684\u6642\u5019\u63a5\u5230\u901a\u77e5\uff08\u4f8b\u5982\u900f\u904e WebSocket\uff09\u3002<\/p>\n<p>\u5b83\u8ddf REST \u4e00\u6a23\u662f\u8cc7\u6e90\u5c0e\u5411\u7684\uff08\u53ea\u662f\u5b83\u53ef\u4ee5\u6bd4\u8f03\u9748\u6d3b\u5730\u5b58\u53d6\u591a\u7a2e\u8cc7\u6e90\uff09\uff0c\u6240\u4ee5\u4e5f\u540c\u6a23\u6709\u898f\u683c\u7d71\u4e00\u7684\u512a\u9ede\uff08\u800c\u4e14\u6bd4 REST \u66f4\u52a0\u7d71\u4e00\uff0c\u56e0\u70ba\u8a9e\u6cd5\u90fd\u6709\u898f\u7bc4\uff0c\u56de\u50b3\u683c\u5f0f\u4e5f\u56fa\u5b9a\u90fd\u662f JSON\uff09\u3001\u4f46\u4e5f\u4e00\u6a23\u6709\u5546\u696d\u908f\u8f2f\u65b9\u9762\u7684\u5f31\u9ede\u3002\u800c GraphQL \u901a\u5e38\u662f\u55ae\u4e00\u7aef\u9ede\u7684\uff0c\u9019\u90e8\u4efd\u5b83\u5247\u6bd4\u8f03\u50cf\u72f9\u7fa9\u7684 RPC\u3002\u76f8\u8f03\u65bc REST\uff0c\u5b83\u9069\u5408\u7684\u60c5\u5883\u662f\u7576\u6574\u500b\u7cfb\u7d71\u6709\u6bd4\u8f03\u8907\u96dc\u7684\u8cc7\u6599\u7d50\u69cb\u3001\u800c\u4e14\u524d\u7aef\u53ef\u80fd\u6703\u6709\u5f88\u591a\u6a23\u5316\u7684\u67e5\u627e\u9700\u6c42\u7684\u6642\u5019\u3002\u4f46\u662f\u4e5f\u8981\u5c0f\u5fc3\uff0c\u5982\u679c GraphQL \u6253\u5305\u4e86\u592a\u8907\u96dc\u7684\u67e5\u627e\uff0c\u5b83\u7684\u6548\u7387\u53ef\u80fd\u53cd\u800c\u6703\u6bd4 REST \u8981\u5dee\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E7%B5%90%E8%AA%9E\"><\/span>\u7d50\u8a9e<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u7e3d\u800c\u8a00\u4e4b\uff0c\u5728 RPC\u3001REST \u548c GraphQL \u9019\u4e09\u7a2e\u6700\u5e38\u88ab\u63d0\u5230\u7684 API \u67b6\u69cb\u4e2d\uff0c\u5b83\u5011\u662f\u5404\u6709\u5404\u7684\u9577\u77ed\u8655\u3001\u4e5f\u5404\u6709\u5176\u9069\u5408\u7684\u5834\u57df\u3002\u9019\u908a\u89e3\u91cb\u4e86\u5b83\u5011\u4e4b\u9593\u6700\u91cd\u8981\u7684\u5c0d\u6bd4\u4e4b\u8655\uff0c\u5e0c\u671b\u5c0d\u5404\u4f4d\u7684\u7406\u89e3\u6703\u6709\u6240\u5e6b\u52a9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>API\uff08Application Programming Interface\uff0c\u61c9\u7528\u7a0b\u5f0f\u4ecb\u9762\uff09\u5927\u5bb6\u90fd\u5728\u7528\uff0c\u4e00\u4e9b\u67b6\u69cb\u8853\u8a9e\u50cf\u662f RPC\u3001REST\u3001GraphQL \u7b49\u7b49\u4e5f\u5e38\u5e38\u807d\u904e\uff0c\u4f46\u662f\u6211\u89ba\u5f97\u7db2\u8def\u4e0a\u7d55\u5927\u90e8\u5206\u7684\u6587\u7ae0&#8230; &raquo; <a class=\"read-more-link\" href=\"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/\">\u95b1\u8b80\u5168\u6587<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,13,1],"tags":[117,118,115,116],"class_list":["post-569","post","type-post","status-publish","format-standard","hentry","category-front-end","category-site","category-essay","tag-graphql","tag-json","tag-rest","tag-rpc"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u7db2\u8def API \u67b6\u69cb\u61f6\u4eba\u5305 - \u661f\u541b\u7814\u7a76\u5ba4<\/title>\n<meta name=\"description\" content=\"API \u5927\u5bb6\u90fd\u5728\u7528\uff0c\u4e00\u4e9b\u67b6\u69cb\u8853\u8a9e\u50cf\u662f RPC\u3001REST\u3001GraphQL \u7b49\u7b49\u4e5f\u5e38\u5e38\u807d\u904e\uff0c\u4f46\u662f\u6211\u89ba\u5f97\u7db2\u8def\u4e0a\u7d55\u5927\u90e8\u5206\u7684\u6587\u7ae0\u90fd\u6c92\u6709\u8b1b\u5230\u5b83\u5011\u7684\u91cd\u9ede\u5728\u54ea\u88e1\u3001\u90fd\u662f\u4e00\u76f4\u5728\u91cd\u8907\u8271\u6f80\u4e14\u4e0d\u5bb9\u6613\u9ad4\u6703\u7684\u5b9a\u7fa9\u3002\u5728\u9019\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u60f3\u7528\u6211\u7684\u8996\u89d2\u4f86\u7c21\u55ae\u89e3\u91cb\u4e00\u4e0b\u9019\u4e9b\u67b6\u69cb\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/\u7db2\u8def-api-\u67b6\u69cb\u61f6\u4eba\u5305\/\" \/>\n<meta property=\"og:locale\" content=\"zh_TW\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7db2\u8def API \u67b6\u69cb\u61f6\u4eba\u5305\" \/>\n<meta property=\"og:description\" content=\"API \u5927\u5bb6\u90fd\u5728\u7528\uff0c\u4e00\u4e9b\u67b6\u69cb\u8853\u8a9e\u50cf\u662f RPC\u3001REST\u3001GraphQL \u7b49\u7b49\u4e5f\u5e38\u5e38\u807d\u904e\uff0c\u4f46\u662f\u6211\u89ba\u5f97\u7db2\u8def\u4e0a\u7d55\u5927\u90e8\u5206\u7684\u6587\u7ae0\u90fd\u6c92\u6709\u8b1b\u5230\u5b83\u5011\u7684\u91cd\u9ede\u5728\u54ea\u88e1\u3001\u90fd\u662f\u4e00\u76f4\u5728\u91cd\u8907\u8271\u6f80\u4e14\u4e0d\u5bb9\u6613\u9ad4\u6703\u7684\u5b9a\u7fa9\u3002\u5728\u9019\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u60f3\u7528\u6211\u7684\u8996\u89d2\u4f86\u7c21\u55ae\u89e3\u91cb\u4e00\u4e0b\u9019\u4e9b\u67b6\u69cb\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/\u7db2\u8def-api-\u67b6\u69cb\u61f6\u4eba\u5305\/\" \/>\n<meta property=\"og:site_name\" content=\"\u661f\u541b\u7814\u7a76\u5ba4\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-08T04:10:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-08T04:11:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/abstreamace.com\/sglab\/wp-content\/uploads\/2023\/12\/image-1702000679927.png\" \/>\n\t<meta property=\"og:image:width\" content=\"720\" \/>\n\t<meta property=\"og:image:height\" content=\"373\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"\u6751\u54e5\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005:\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6751\u54e5\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9810\u4f30\u95b1\u8b80\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\u9418\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/2023\\\/12\\\/08\\\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/2023\\\/12\\\/08\\\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\\\/\"},\"author\":{\"name\":\"\u6751\u54e5\",\"@id\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/#\\\/schema\\\/person\\\/ce693dccce8e7877f768f171b97df0de\"},\"headline\":\"\u7db2\u8def API \u67b6\u69cb\u61f6\u4eba\u5305\",\"datePublished\":\"2023-12-08T04:10:07+00:00\",\"dateModified\":\"2023-12-08T04:11:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/2023\\\/12\\\/08\\\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\\\/\"},\"wordCount\":117,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/#\\\/schema\\\/person\\\/ce693dccce8e7877f768f171b97df0de\"},\"image\":{\"@id\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/2023\\\/12\\\/08\\\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/image-1702000679927.png\",\"keywords\":[\"GraphQL\",\"JSON\",\"REST\",\"RPC\"],\"articleSection\":[\"\u524d\u7aef\u6280\u8853\",\"\u5f8c\u7aef\u6280\u8853\",\"\u96a8\u7b46\"],\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/2023\\\/12\\\/08\\\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/2023\\\/12\\\/08\\\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\\\/\",\"url\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/2023\\\/12\\\/08\\\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\\\/\",\"name\":\"\u7db2\u8def API \u67b6\u69cb\u61f6\u4eba\u5305 - \u661f\u541b\u7814\u7a76\u5ba4\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/2023\\\/12\\\/08\\\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/2023\\\/12\\\/08\\\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/image-1702000679927.png\",\"datePublished\":\"2023-12-08T04:10:07+00:00\",\"dateModified\":\"2023-12-08T04:11:10+00:00\",\"description\":\"API \u5927\u5bb6\u90fd\u5728\u7528\uff0c\u4e00\u4e9b\u67b6\u69cb\u8853\u8a9e\u50cf\u662f RPC\u3001REST\u3001GraphQL \u7b49\u7b49\u4e5f\u5e38\u5e38\u807d\u904e\uff0c\u4f46\u662f\u6211\u89ba\u5f97\u7db2\u8def\u4e0a\u7d55\u5927\u90e8\u5206\u7684\u6587\u7ae0\u90fd\u6c92\u6709\u8b1b\u5230\u5b83\u5011\u7684\u91cd\u9ede\u5728\u54ea\u88e1\u3001\u90fd\u662f\u4e00\u76f4\u5728\u91cd\u8907\u8271\u6f80\u4e14\u4e0d\u5bb9\u6613\u9ad4\u6703\u7684\u5b9a\u7fa9\u3002\u5728\u9019\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u60f3\u7528\u6211\u7684\u8996\u89d2\u4f86\u7c21\u55ae\u89e3\u91cb\u4e00\u4e0b\u9019\u4e9b\u67b6\u69cb\u3002\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/2023\\\/12\\\/08\\\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\\\/#breadcrumb\"},\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/2023\\\/12\\\/08\\\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/2023\\\/12\\\/08\\\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\\\/#primaryimage\",\"url\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/image-1702000679927.png\",\"contentUrl\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/image-1702000679927.png\",\"width\":720,\"height\":373},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/2023\\\/12\\\/08\\\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9801\",\"item\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7db2\u8def API \u67b6\u69cb\u61f6\u4eba\u5305\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/#website\",\"url\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/\",\"name\":\"\u661f\u541b\u7814\u7a76\u5ba4\",\"description\":\"\u71b1\u611b\u958b\u6e90\u958b\u767c\u7684\u5168\u7aef\u5de5\u7a0b\u5e2b\u90e8\u843d\u683c\",\"publisher\":{\"@id\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/#\\\/schema\\\/person\\\/ce693dccce8e7877f768f171b97df0de\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-TW\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/abstreamace.com\\\/sglab\\\/#\\\/schema\\\/person\\\/ce693dccce8e7877f768f171b97df0de\",\"name\":\"\u6751\u54e5\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/edfd94bec8b67286068ace1dbbee073411195f91272f71bbf1ba7e0284b26c22?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/edfd94bec8b67286068ace1dbbee073411195f91272f71bbf1ba7e0284b26c22?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/edfd94bec8b67286068ace1dbbee073411195f91272f71bbf1ba7e0284b26c22?s=96&d=mm&r=g\",\"caption\":\"\u6751\u54e5\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/edfd94bec8b67286068ace1dbbee073411195f91272f71bbf1ba7e0284b26c22?s=96&d=mm&r=g\"},\"sameAs\":[\"https:\\\/\\\/abstreamace.com\\\/sglab\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u7db2\u8def API \u67b6\u69cb\u61f6\u4eba\u5305 - \u661f\u541b\u7814\u7a76\u5ba4","description":"API \u5927\u5bb6\u90fd\u5728\u7528\uff0c\u4e00\u4e9b\u67b6\u69cb\u8853\u8a9e\u50cf\u662f RPC\u3001REST\u3001GraphQL \u7b49\u7b49\u4e5f\u5e38\u5e38\u807d\u904e\uff0c\u4f46\u662f\u6211\u89ba\u5f97\u7db2\u8def\u4e0a\u7d55\u5927\u90e8\u5206\u7684\u6587\u7ae0\u90fd\u6c92\u6709\u8b1b\u5230\u5b83\u5011\u7684\u91cd\u9ede\u5728\u54ea\u88e1\u3001\u90fd\u662f\u4e00\u76f4\u5728\u91cd\u8907\u8271\u6f80\u4e14\u4e0d\u5bb9\u6613\u9ad4\u6703\u7684\u5b9a\u7fa9\u3002\u5728\u9019\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u60f3\u7528\u6211\u7684\u8996\u89d2\u4f86\u7c21\u55ae\u89e3\u91cb\u4e00\u4e0b\u9019\u4e9b\u67b6\u69cb\u3002","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:\/\/abstreamace.com\/sglab\/2023\/12\/08\/\u7db2\u8def-api-\u67b6\u69cb\u61f6\u4eba\u5305\/","og_locale":"zh_TW","og_type":"article","og_title":"\u7db2\u8def API \u67b6\u69cb\u61f6\u4eba\u5305","og_description":"API \u5927\u5bb6\u90fd\u5728\u7528\uff0c\u4e00\u4e9b\u67b6\u69cb\u8853\u8a9e\u50cf\u662f RPC\u3001REST\u3001GraphQL \u7b49\u7b49\u4e5f\u5e38\u5e38\u807d\u904e\uff0c\u4f46\u662f\u6211\u89ba\u5f97\u7db2\u8def\u4e0a\u7d55\u5927\u90e8\u5206\u7684\u6587\u7ae0\u90fd\u6c92\u6709\u8b1b\u5230\u5b83\u5011\u7684\u91cd\u9ede\u5728\u54ea\u88e1\u3001\u90fd\u662f\u4e00\u76f4\u5728\u91cd\u8907\u8271\u6f80\u4e14\u4e0d\u5bb9\u6613\u9ad4\u6703\u7684\u5b9a\u7fa9\u3002\u5728\u9019\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u60f3\u7528\u6211\u7684\u8996\u89d2\u4f86\u7c21\u55ae\u89e3\u91cb\u4e00\u4e0b\u9019\u4e9b\u67b6\u69cb\u3002","og_url":"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/\u7db2\u8def-api-\u67b6\u69cb\u61f6\u4eba\u5305\/","og_site_name":"\u661f\u541b\u7814\u7a76\u5ba4","article_published_time":"2023-12-08T04:10:07+00:00","article_modified_time":"2023-12-08T04:11:10+00:00","og_image":[{"width":720,"height":373,"url":"https:\/\/abstreamace.com\/sglab\/wp-content\/uploads\/2023\/12\/image-1702000679927.png","type":"image\/png"}],"author":"\u6751\u54e5","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005:":"\u6751\u54e5","\u9810\u4f30\u95b1\u8b80\u6642\u9593":"1 \u5206\u9418"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/#article","isPartOf":{"@id":"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/"},"author":{"name":"\u6751\u54e5","@id":"https:\/\/abstreamace.com\/sglab\/#\/schema\/person\/ce693dccce8e7877f768f171b97df0de"},"headline":"\u7db2\u8def API \u67b6\u69cb\u61f6\u4eba\u5305","datePublished":"2023-12-08T04:10:07+00:00","dateModified":"2023-12-08T04:11:10+00:00","mainEntityOfPage":{"@id":"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/"},"wordCount":117,"commentCount":0,"publisher":{"@id":"https:\/\/abstreamace.com\/sglab\/#\/schema\/person\/ce693dccce8e7877f768f171b97df0de"},"image":{"@id":"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/#primaryimage"},"thumbnailUrl":"https:\/\/abstreamace.com\/sglab\/wp-content\/uploads\/2023\/12\/image-1702000679927.png","keywords":["GraphQL","JSON","REST","RPC"],"articleSection":["\u524d\u7aef\u6280\u8853","\u5f8c\u7aef\u6280\u8853","\u96a8\u7b46"],"inLanguage":"zh-TW","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/","url":"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/","name":"\u7db2\u8def API \u67b6\u69cb\u61f6\u4eba\u5305 - \u661f\u541b\u7814\u7a76\u5ba4","isPartOf":{"@id":"https:\/\/abstreamace.com\/sglab\/#website"},"primaryImageOfPage":{"@id":"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/#primaryimage"},"image":{"@id":"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/#primaryimage"},"thumbnailUrl":"https:\/\/abstreamace.com\/sglab\/wp-content\/uploads\/2023\/12\/image-1702000679927.png","datePublished":"2023-12-08T04:10:07+00:00","dateModified":"2023-12-08T04:11:10+00:00","description":"API \u5927\u5bb6\u90fd\u5728\u7528\uff0c\u4e00\u4e9b\u67b6\u69cb\u8853\u8a9e\u50cf\u662f RPC\u3001REST\u3001GraphQL \u7b49\u7b49\u4e5f\u5e38\u5e38\u807d\u904e\uff0c\u4f46\u662f\u6211\u89ba\u5f97\u7db2\u8def\u4e0a\u7d55\u5927\u90e8\u5206\u7684\u6587\u7ae0\u90fd\u6c92\u6709\u8b1b\u5230\u5b83\u5011\u7684\u91cd\u9ede\u5728\u54ea\u88e1\u3001\u90fd\u662f\u4e00\u76f4\u5728\u91cd\u8907\u8271\u6f80\u4e14\u4e0d\u5bb9\u6613\u9ad4\u6703\u7684\u5b9a\u7fa9\u3002\u5728\u9019\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u60f3\u7528\u6211\u7684\u8996\u89d2\u4f86\u7c21\u55ae\u89e3\u91cb\u4e00\u4e0b\u9019\u4e9b\u67b6\u69cb\u3002","breadcrumb":{"@id":"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/#breadcrumb"},"inLanguage":"zh-TW","potentialAction":[{"@type":"ReadAction","target":["https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/"]}]},{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/#primaryimage","url":"https:\/\/abstreamace.com\/sglab\/wp-content\/uploads\/2023\/12\/image-1702000679927.png","contentUrl":"https:\/\/abstreamace.com\/sglab\/wp-content\/uploads\/2023\/12\/image-1702000679927.png","width":720,"height":373},{"@type":"BreadcrumbList","@id":"https:\/\/abstreamace.com\/sglab\/2023\/12\/08\/%e7%b6%b2%e8%b7%af-api-%e6%9e%b6%e6%a7%8b%e6%87%b6%e4%ba%ba%e5%8c%85\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9801","item":"https:\/\/abstreamace.com\/sglab\/"},{"@type":"ListItem","position":2,"name":"\u7db2\u8def API \u67b6\u69cb\u61f6\u4eba\u5305"}]},{"@type":"WebSite","@id":"https:\/\/abstreamace.com\/sglab\/#website","url":"https:\/\/abstreamace.com\/sglab\/","name":"\u661f\u541b\u7814\u7a76\u5ba4","description":"\u71b1\u611b\u958b\u6e90\u958b\u767c\u7684\u5168\u7aef\u5de5\u7a0b\u5e2b\u90e8\u843d\u683c","publisher":{"@id":"https:\/\/abstreamace.com\/sglab\/#\/schema\/person\/ce693dccce8e7877f768f171b97df0de"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/abstreamace.com\/sglab\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-TW"},{"@type":["Person","Organization"],"@id":"https:\/\/abstreamace.com\/sglab\/#\/schema\/person\/ce693dccce8e7877f768f171b97df0de","name":"\u6751\u54e5","image":{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/secure.gravatar.com\/avatar\/edfd94bec8b67286068ace1dbbee073411195f91272f71bbf1ba7e0284b26c22?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/edfd94bec8b67286068ace1dbbee073411195f91272f71bbf1ba7e0284b26c22?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/edfd94bec8b67286068ace1dbbee073411195f91272f71bbf1ba7e0284b26c22?s=96&d=mm&r=g","caption":"\u6751\u54e5"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/edfd94bec8b67286068ace1dbbee073411195f91272f71bbf1ba7e0284b26c22?s=96&d=mm&r=g"},"sameAs":["https:\/\/abstreamace.com\/sglab"]}]}},"_links":{"self":[{"href":"https:\/\/abstreamace.com\/sglab\/wp-json\/wp\/v2\/posts\/569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/abstreamace.com\/sglab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/abstreamace.com\/sglab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/abstreamace.com\/sglab\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/abstreamace.com\/sglab\/wp-json\/wp\/v2\/comments?post=569"}],"version-history":[{"count":0,"href":"https:\/\/abstreamace.com\/sglab\/wp-json\/wp\/v2\/posts\/569\/revisions"}],"wp:attachment":[{"href":"https:\/\/abstreamace.com\/sglab\/wp-json\/wp\/v2\/media?parent=569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/abstreamace.com\/sglab\/wp-json\/wp\/v2\/categories?post=569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/abstreamace.com\/sglab\/wp-json\/wp\/v2\/tags?post=569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}