{"id":427160,"date":"2021-04-14T13:27:31","date_gmt":"2021-04-14T05:27:31","guid":{"rendered":"http:\/\/4563.org\/?p=427160"},"modified":"2021-04-14T13:27:31","modified_gmt":"2021-04-14T05:27:31","slug":"%e6%b1%82%e6%95%99%e4%b8%80%e4%b8%aa-api-%e8%ae%be%e8%ae%a1%e9%9a%be%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=427160","title":{"rendered":"\u6c42\u6559\u4e00\u4e2a API \u8bbe\u8ba1\u96be\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6c42\u6559\u4e00\u4e2a API \u8bbe\u8ba1\u96be\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Yelp <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6700\u8fd1\u5728\u5199\u4e00\u4e2a\u5e94\u7528\uff0c\u6d89\u53ca\u5230\u51e0\u4e2a\u5916\u90e8\u6570\u636e\u6e90\u7684\u64cd\u4f5c\uff0cAPI \u8bbe\u8ba1\u4e0a\u6709\u4e00\u4e9b\u77db\u76fe\uff0c\u5927\u5bb6\u89c9\u5f97\u54ea\u79cd\u597d\uff0c\u8fd8\u662f\u6709\u5176\u4ed6\u7684\u8bbe\u8ba1\uff1f<\/p>\n<ol>\n<li>\u521b\u5efa\u6570\u636e\u6e90<\/li>\n<\/ol>\n<pre><code>POST \/data-source <\/code><\/pre>\n<ol>\n<li>\u83b7\u53d6\u652f\u6301\u7684\u6570\u636e\u6e90\u7c7b\u578b\u5217\u8868<\/li>\n<\/ol>\n<pre><code>\/\/ \u611f\u89c9 URL \u592a\u957f GET \/data-source-type  \/\/ \u8ddf GET \/data-source\/{id} \u91cd\u53e0\u4e86 GET \/data-source\/types <\/code><\/pre>\n<ol>\n<li>\u63d0\u4f9b\u8fde\u63a5\u53c2\u6570\uff0c\u68c0\u6d4b\u6570\u636e\u6e90\u662f\u5426\u53ef\u7528<\/li>\n<\/ol>\n<pre><code>POST \/data-source-check POST \/data-source?action=check <\/code><\/pre>\n<ol>\n<li>\u521b\u5efa\u4e4b\u524d\u521d\u59cb\u5316\u6570\u636e\u6e90\uff0c\u6bd4\u5982\u521b\u5efa MySQL \u8868<\/li>\n<\/ol>\n<pre><code>POST \/data-source-init POST \/data-source\/init POST \/data-source?action=init <\/code><\/pre>\n<p>\u603b\u7ed3\u6765\u8bf4\u5c31\u662f \u5bf9\u8c61\u672a\u521b\u5efa\u4e4b\u524d\u8fdb\u884c\u7684\u4e00\u4e9b\u64cd\u4f5c\u600e\u4e48\u8bbe\u8ba1\uff0c\u6bd4\u5982\uff1a<\/p>\n<p>\u68c0\u67e5\u7528\u6237\u662f\u5426\u5b58\u5728 vs \u521b\u5efa\u4e00\u4e2a\u7528\u6237<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>11<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5735755\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : doublleft <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u90fd\u662f\u64cd\u4f5c data-source \u7684\u8bdd\uff0c\u53ef\u4ee5\u52a0\u4e2a\u7c7b\u522b<\/p>\n<p>\u4f8b\u5982\uff1a\/data-source\/detail\/1 \u3001\/data-source\/types \u3001\/data-source\/init                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5735756\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : baiyi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5728 URL \u7684\u8bbe\u8ba1\u4e0a\u6211\u89c9\u5f97\u80fd\u591f\u8bed\u4e49\u6e05\u6670\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>\u201c\u83b7\u53d6\u652f\u6301\u7684\u6570\u636e\u6e90\u7c7b\u578b\u5217\u8868\u201d \u6211\u8ba4\u4e3a\u4e24\u79cd\u8bbe\u8ba1\u90fd\u53ef\u4ee5\uff0c\u751a\u81f3 `GET \/data-source?filter=types` \u8fd9\u6837\u4e5f\u53ef\u4ee5\uff0c\u90fd\u662f\u8868\u8fbe\u53ea\u83b7\u53d6 types \u3002<\/p>\n<p>\u4f46 \u201c\u63d0\u4f9b\u8fde\u63a5\u53c2\u6570\uff0c\u68c0\u6d4b\u6570\u636e\u6e90\u662f\u5426\u53ef\u7528\u201d \u6211\u8ba4\u4e3a\u4e0d\u5e94\u8be5\u7528 POST \u65b9\u6cd5\uff0cping \u8fd9\u79cd\u884c\u4e3a\u5728\u6211\u770b\u6765\u5e94\u8be5\u662f\u5b89\u5168\u4e14\u5e42\u7b49\u7684\uff0c\u5e94\u8be5\u7528 GET \u65b9\u6cd5\u3002\u6240\u4ee5\u8fd9\u91cc\u5408\u9002\u7684\u8bbe\u8ba1\u5e94\u8be5\u662f \u201cGET \/ping-data-source\u201d<\/p>\n<p>\u5728\u6211\u770b\u6765\u4f60\u7684\u601d\u8003\u77db\u76fe\u4e3b\u8981\u5728\u4e8e\uff1a\u4f60\u8ba4\u4e3a HTTP Methods \u90fd\u662f\u9488\u5bf9\u8d44\u6e90\u7684\u64cd\u4f5c\uff0c\u800c\u8fd9\u4e2a\u8d44\u6e90\u53c8\u88ab\u5c40\u9650\u4e8e\u5b9e\u4f53\u5b58\u5728\u7684\u8d44\u6e90\u3002<br \/>\u4f46\u8fd9\u4e2a\u8d44\u6e90\u5b9e\u9645\u4e0a\u53ef\u4ee5\u662f\u62bd\u8c61\u7684\u3001\u52a8\u6001\u7684\uff0c\u6bd4\u5982\u8bf4\u7528 RESTful \u98ce\u683c\u8bbe\u8ba1\u6700\u5e38\u89c1\u7684\u95ee\u9898\u5c31\u662f \u201c\u767b\u5f55\u201d \u8fd9\u4e2a\u63a5\u53e3\u5982\u4f55\u8bbe\u8ba1\u3002\u5176\u5b9e\u53ea\u9700\u8981 `POST \/login` \u5c31\u53ef\u4ee5\u3002\u4ece HTTP POST \u65b9\u6cd5\u672c\u8eab\u7684\u8bed\u4e49\u8bb2\uff0c\u662f\u5b8c\u5168\u652f\u6301\u8fd9\u6837\u505a\u7684\uff0c\u5b83\u5e76\u4e0d\u662f\u5355\u7eaf\u7684\u7528\u4e8e\u521b\u5efa\u8d44\u6e90\u7684\u8bed\u4e49\u3002rfc \u6587\u6863\u4e2d\u5173\u4e8e POST \u80fd\u529b\u7684\u90e8\u5206\u89e3\u91ca\uff1a\u201cProviding a block of data, such as the fields entered into an HTML form, to a data-handling process;\u201d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5735757\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : baiyi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @baiyi #2 \u8865\u5145\u4e00\u70b9\uff0c\u6211\u770b\u7684\u4e00\u672c\u5173\u4e8e RESTful API \u7684\u4e66\u91cc\u5410\u69fd\u8fc7\u8fd9\u4e2a\u89e3\u91ca\uff0c\u56e0\u4e3a\u8fd9\u4e2a \u201cdata-handling process\u201d \u542b\u4e49\u592a\u8fc7\u6a21\u7cca\uff0c\u6240\u4ee5\u73b0\u5728\u6709\u4eba\u7684\u63a5\u53e3\u8bbe\u8ba1\u4e3a\u5168\u7528 POST\uff0c\u5176\u5b9e\u4e5f\u662f\u7b26\u5408 HTTP \u8bed\u4e49\u7684\uff0c\u56e0\u4e3a\u4efb\u4f55\u64cd\u4f5c\u90fd\u80fd\u5f15\u7533\u4e3a\u6570\u636e\u5904\u7406&#8230;&#8230;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5735758\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : no1xsyzy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             1. POST \/data-source<br \/>2. GET \/data-source\/_types<br \/>3. POST \/data-source\/_ping<br \/>4. POST \/data-source\/_initialization<\/p>\n<p>\u7528 _ \u6765\u8868\u793a meta \u64cd\u4f5c\uff0c\u662f\u5b8c\u5168\u53ef\u7406\u89e3\u3001\u4e14\u5e38\u89c4\u7684\u3002\u800c\u4e14\u8d8a\u4e0d\u5e38\u89c1\u7684\u64cd\u4f5c\u540d\u5b57\u5e94\u5f53\u8d8a\u5b8c\u6574\u3001\u6700\u597d\u957f\u5f97\u591a\u3002<br \/>\u4f46\u662f\u4ee4\u6211\u8ff7\u60d1\u7684\u662f\uff0c\u4e3a\u4ec0\u4e48\u4f1a\u6709\u5355\u72ec\u7684 4. \u64cd\u4f5c\uff1f\u4e0d\u5e94\u8be5 1. \u64cd\u4f5c\u65f6\u76f4\u63a5\u505a\u6389\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5735759\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : opengps <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             POST +header \u6216\u8005 body \u91cc\u4f20\u53c2                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5735760\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SuperMild <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             RESTful \u8868\u9762\u4e0a\u770b\u8d77\u6765\u4f18\u96c5\uff0c\u4f46\u771f\u7684\u4e0d\u597d\u7528\uff08\u4e0d\u5bb9\u6613\u7528\u597d\uff09\uff0c\u7528\u8d77\u6765\u5f88\u70e6\u3002<\/p>\n<p>\u73b0\u5728\u6211\u7684\u4e2a\u4eba\u9879\u76ee\u5df2\u7ecf\u5b8c\u5168\u653e\u5f03 RESTful, \u6539\u6210 GET POST \u8d70\u5929\u4e0b\u3002<\/p>\n<p>\u56e0\u6b64\u6211\u89c9\u5f97 GET \/data-source-types \u5c31\u5f88\u597d\uff0c\u8bed\u4e49\u975e\u5e38\u6e05\u6670\uff0c\u4e5f\u6ca1\u6709\u6bd4 GET \/data-source\/types \u66f4\u957f\uff08\u957f\u5ea6\u4e00\u6837\uff09\u3002\u7f3a\u70b9\u53ea\u662f\u4ece RESTful \u7684\u89d2\u5ea6\u770b\u4e0d\u591f\u4f18\u96c5\uff08\u6211\u4e2a\u4eba\u8ba4\u4e3a\u90a3\u79cd\u4f18\u96c5\u5e26\u6765\u7684\u9ebb\u70e6\u6bd4\u597d\u5904\u591a\uff09\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5735761\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mlcq <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @SuperMild #6 \u4f60\u8fd9\u6837\u4e0d\u65b9\u4fbf\u6743\u9650\u63a7\u5236                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5735762\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : blackboom <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             GET \/data-sources<\/p>\n<p>POST \/data-sources\/types<br \/>POST \/data-sources\/actions\/check<\/p>\n<p>\u4e0d\u80fd\u4f7f\u7528 RESTful \u8868\u8fbe\u7684\u4e00\u5f8b\u4f7f\u7528 POST \u4f5c\u4e3a \u201cFunction\u201d \u8c03\u7528                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5735763\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : arthas2234 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u5c31\u559c\u6b22\u5728\u63a5\u53e3\u540d\u5b57\u4e0a\u5c3d\u91cf\u628a\u7528\u9014\u4f53\u73b0\u51fa\u6765\u3002\u8fd9\u6837\u5c31\u5f88\u76f4\u767d\uff0c\u770b\u63a5\u53e3\u540d\u5c31\u77e5\u9053\u505a\u4ec0\u4e48\u7684\uff0c\u5e76\u4e0d\u9700\u8981\u518d\u53bb\u770b\u53c2\u6570\u5217\u8868                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5735764\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SuperMild <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @mlcq \u6743\u9650\u63a7\u5236\u4e0d\u5728\u8fd9\u4e00\u5c42\uff0c\u56e0\u4e3a\u4e3b\u8fd8\u6709\u4e00\u4e2a GET \/data-source\/{id}, \u56e0\u6b64 data-source \u5c31\u53ea\u6709\u4e00\u4e2a\uff0c\u6ca1\u6709 data-source1 \u3001data-source2 (\u56e0\u4e3a\u90a3\u5c31\u5e94\u8be5\u662f \/data-source\/1 \u3001\/data-source\/2)<\/p>\n<p>\u56e0\u6b64\u53ea\u6709\u4e00\u4e2a\u5168\u90e8\u6570\u636e\u6e90\u5171\u7528\u7684 \/data-source-types\uff0c\u4e0d\u9700\u8981\u533a\u5206 \/data-source1\/types \u3001\/data-source2\/types                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5735765\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cmdOptionKana <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @SuperMild \u4e0d\u5bf9\uff0c\u4f60\u60f3\u9519\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6c42\u6559\u4e00\u4e2a API \u8bbe\u8ba1\u96be\u9898 \u8cc7\u6df1\u5927&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/427160"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=427160"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/427160\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=427160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=427160"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=427160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}