{"id":171902,"date":"2020-10-25T05:26:38","date_gmt":"2020-10-24T21:26:38","guid":{"rendered":"http:\/\/4563.org\/?p=171902"},"modified":"2020-10-25T05:26:38","modified_gmt":"2020-10-24T21:26:38","slug":"%e5%85%b3%e4%ba%8e-rest-%e5%92%8c-rest-api-%e7%9a%84%e4%b8%80%e4%ba%9b%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=171902","title":{"rendered":"\u5173\u4e8e REST \u548c REST API \u7684\u4e00\u4e9b\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5173\u4e8e REST \u548c REST API \u7684\u4e00\u4e9b\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cmai <\/span>  <span><i><\/i> 2<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<h2>REST \u7a76\u7adf\u662f\u4ec0\u4e48<\/h2>\n<ol>\n<li>\u5728\u770b [\u5fae\u670d\u52a1\u67b6\u6784\u8bbe\u8ba1\u6a21\u5f0f] \u7684\u65f6\u5019\uff0c\u63d0\u5230\u5fae\u670d\u52a1\u901a\u5e38\u4f7f\u7528\u8f7b\u91cf\u7ea7\u534f\u8bae\u4f8b\u5982 REST \u6216 gRPC<\/li>\n<li>\u6709\u8bf4 Spring Cloud \u57fa\u4e8e REST API \u4f5c\u4e3a\u670d\u52a1\u8c03\u7528<\/li>\n<li>\u4e5f\u6709\u8bf4\u662f\u901a\u4fe1\u673a\u5236(\u5fd8\u4e86\u54ea\u672c\u4e66\u8fd8\u662f\u54ea\u4e2a\u6587\u7ae0\u4e86),\u670d\u52a1\u4e8e\u670d\u52a1\u95f4\u91c7\u7528\u8f7b\u91cf\u7ea7\u7684\u901a\u4fe1\u673a\u5236\u4e92\u76f8\u6c9f\u901a\uff08\u901a\u5e38\u662f\u57fa\u4e8e HTTP \u7684 RESTful API \uff09<\/li>\n<\/ol>\n<h2>\u7591\u95ee<\/h2>\n<ol>\n<li>cloud \u4e0d\u662f\u57fa\u4e8e feign \u8fd9\u79cd\u7ec4\u4ef6\u4e48\uff0cfeign \u5e94\u8be5\u53ea\u662f\u5c01\u88c5\u4e86 http \u64cd\u4f5c\u800c\u5df2\u5427(\u6682\u65f6\u5ffd\u7565\u8d1f\u8f7d\u5747\u8861),\u4e3a\u4ec0\u4e48\u8bf4\u57fa\u4e8e REST API<\/li>\n<li>REST \u4e0d\u662f\u4e00\u79cd\u67b6\u6784\u98ce\u683c\u4e48\uff1f\u63d0\u5021 url \u63cf\u8ff0\u8d44\u6e90\uff0cHTTP Method \u63cf\u8ff0\u52a8\u4f5c\uff0c \u7b26\u5408\u8fd9\u79cd\u67b6\u6784\u98ce\u683c\u7684\u5c31\u662f RESTful API\uff0c\u548c\u901a\u4fe1\u673a\u5236 \/\u534f\u8bae\u6709\u4ec0\u4e48\u5173\u7cfb\u5462<\/li>\n<li>REST API \u53c8\u662f\u4e2a\u5565????<\/li>\n<\/ol>\n<p>\u671b\u4e0d\u541d\u8d50\u6559<\/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=\"3867128\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xumng123 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5c06 restful \u8fd9\u79cd url \u8868\u793a\u8d44\u6e90\uff0c\u91c7\u7528 http \u7684 method \u7684\u901a\u4fe1\u673a\u5236\u7528\u4e8e\u5fae\u670d\u52a1\u4e4b\u95f4\u901a\u8baf\u3002\u5fae\u670d\u52a1\u4e4b\u95f4\u5f53\u7136\u4e0d\u9650\u4e8e restful \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3867130\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : abbycin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u5f88\u5feb\u7684\u53d1\u73b0\uff0c\u5176\u5b9e\u8fd9\u672c\u4e66\u7684\u4f5c\u8005\u53ea\u662f\u7ed9\u65e9\u5df2\u7ecf\u5b58\u5728\u7684\u7f16\u7a0b\u65b9\u6cd5\u8d77\u4e86\u4e00\u4e9b\u65b0\u7684\u540d\u5b57\u800c\u5df2\u3002<br \/> \u2014\u2014 \u738b\u57a0 \u300a\u8c08\u8bbe\u8ba1\u6a21\u5f0f\u300b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3867131\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : guiqiqi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u4e2a\u4eba\u7406\u89e3\u54c8\uff0cRESTful API \u5c31\u662f\u4e00\u79cd\u57fa\u4e8e HTTP \u7684 API \u7684\u8bbe\u8ba1\u98ce\u683c\uff0c\u5145\u5206\u5229\u7528 HTTP \u52a8\u4f5c\u5b57\uff0c\u5c06\u4e00\u5207\u90fd\u770b\u6210\u8d44\u6e90\u53bb\u7ba1\u7406\u3001\u8bbf\u95ee\u3002<br \/>\u56e0\u4e3a HTTP \u7684\u52a8\u4f5c\u5b57\u5f88\u8d34\u8fd1\u5b9e\u9645\u4e1a\u52a1\u4e2d\u7684 CRUD\uff0c\u63cf\u8ff0\u8d77\u6765\u4e5f\u66f4\u52a0\u81ea\u7136\uff0c\u6240\u4ee5\u6211\u4eec\u66f4\u559c\u6b22\u5b83                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3867133\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : woahishui <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5929\u5929\u9e21\u5df4\u778e\u626f\u6982\u5ff5\uff0c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3867135\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : abersheeran <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0a\u8bf4\u7684\u5bf9\uff0c\u90fd\u662f\u7ed9\u8001\u4e1c\u897f\u4e00\u4e2a\u65b0\u540d\u5b57\uff0c\u7136\u540e\u5c31\u662f\u65b0\u6982\u5ff5\u4e86\u3002\u522b\u7ba1\u5c31\u884c\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3867136\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : chendy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             REST \u662f\u4e00\u79cd\u67b6\u6784\u98ce\u683c<br \/>\u7b26\u5408 REST \u8bbe\u8ba1\u98ce\u683c\u7684 Web API \u79f0\u4e3a RESTful API<br \/>\u4ee5\u4e0a\u590d\u5236\u7c98\u8d34\u81ea REST \u7684\u7ef4\u57fa\u767e\u79d1\u2026                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3867138\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lululau <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e07\u6709\u5f15\u529b\u662f\u5b87\u5b99\u672c\u6765\u5c31\u5b58\u5728\u7684\u89c4\u5f8b\u554a\uff0c\u725b\u987f\u53ea\u662f\u7ed9\u5b83\u8d77\u4e86\u4e2a\u540d\u5b57\u800c\u5df2\uff0c\u5475\u5475\uff0c\u8111\u5b50\u662f\u4e2a\u597d\u4e1c\u897f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3867140\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wybhdxfx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0a\u73ed\u5199\u4ee3\u7801\u65f6\uff0c\u60f3\u7528\u5c3d\u91cf\u7b26\u5408 RESTful API \u7684\u98ce\u683c\u53bb\u5199\u63a5\u53e3\uff0c\u9879\u76ee\u7ecf\u7406\u8bf4\u53ea\u7528 get post \u8bf7\u6c42\uff0c\u5176\u4ed6\u4e00\u6982\u4e0d\u7528\uff0c\u8bf4\u5f97\u6700\u591a\u4e00\u53e5\u5c31\u662f\u5148\u5b9e\u73b0\u529f\u80fd\uff0c\u4ee5\u540e\u518d\u4f18\u5316\u3002\/\u624b\u52a8\u659c\u773c\u7b11                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3867141\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tamer <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lululau \u53ea\u8d77\u4e86\u4e2a\u540d\u5b57?\u8fd9\u4e2a\u6bd4\u55bb\u5e76\u4e0d\u597d\u7b11                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3867143\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : cmai <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u60f3\u8ba8\u8bba\u7684\u91cd\u70b9\u5728\u4e8e \uff0c\u4ed6\u63d0\u51fa\u7684\u65b0\u6982\u5ff5\uff0c\u65b0\u540d\u5b57\u5728\u6211\u770b\u6765\u662f\u4e0d\u6b63\u786e\u7684\uff0c\u662f\u6211\u7f3a\u5c11\u4e86\u4ec0\u4e48\u77e5\u8bc6\u5417\uff1f \u6bd4\u5982 SpringCloud \u57fa\u4e8e REST API \u8c03\u7528\u670d\u52a1\uff0c \u6211\u660e\u660e\u662f\u57fa\u4e8e HTTP \u7684\uff0c\u81f3\u4e8e REST API\uff0c\u6211\u54ea\u6015\u4e0d\u9075\u5b88\u8fd9\u79cd\u67b6\u6784\u8bbe\u8ba1\u4e5f\u4e0d\u5f71\u54cd\u6211\u7684\u8c03\u7528\u5427\uff0c \u8fd8\u6709\u8bf4 REST \u662f\u8f7b\u91cf\u7ea7\u534f\u8bae\u7684\uff0c \u8fd9\u4e2a\u6211\u5927\u6982\u7406\u89e3\u4e00\u70b9\u70b9\uff0c \u4f46\u662f\u6211\u7406\u89e3\u7684\u662f\u4ed6\u662f\u57fa\u4e8e HTTP \u4e4b\u4e0a\u7684\u534f\u8bae\uff0c\u89c4\u5b9a\u4e86\u63a5\u53e3\u7684\u8bbe\u8ba1\u98ce\u683c\u548c\u8fd4\u56de\u503c\u7684\u89c4\u8303\uff0c\u548c HTTP \u4e0d\u662f\u540c\u4e00\u4e2a\u5c42\u7ea7\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3867145\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : cmai <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u73b0\u5728\u9ed8\u8ba4\u628a REST API \u5f53\u6210 RESTful API \u7406\u89e3                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5173\u4e8e REST \u548c REST AP&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\/171902"}],"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=171902"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/171902\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=171902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=171902"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=171902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}