{"id":85926,"date":"2020-05-15T13:42:55","date_gmt":"2020-05-15T05:42:55","guid":{"rendered":"http:\/\/4563.org\/?p=85926"},"modified":"2020-05-15T13:42:55","modified_gmt":"2020-05-15T05:42:55","slug":"%e4%ba%8c%e5%8d%81%e5%88%86%e9%92%9f%e5%b0%81%e8%a3%85%ef%bc%8c%e4%b8%80%e4%b8%aa-app-%e5%89%8d%e5%90%8e%e5%8f%b0-http-%e4%ba%a4%e4%ba%92%e7%9a%84%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=85926","title":{"rendered":"\u4e8c\u5341\u5206\u949f\u5c01\u88c5\uff0c\u4e00\u4e2a App \u524d\u540e\u53f0 Http \u4ea4\u4e92\u7684\u5b9e\u73b0"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u4e8c\u5341\u5206\u949f\u5c01\u88c5\uff0c\u4e00\u4e2a App \u524d\u540e\u53f0 Http \u4ea4\u4e92\u7684\u5b9e\u73b0               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : rufeng008 <\/span>  <span><i><\/i> 4<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u5728 React Native \u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u51e0\u4e4e\u6240\u6709\u7684 app \u90fd\u9700\u8981\u4f7f\u7528\u5230 Http \u8bf7\u6c42\uff0c\u6240\u4ee5 fetch \u7684\u5c01\u88c5\u5fc5\u4e0d\u53ef\u5c11\uff0c\u7531\u4e8e\u4e0d\u540c app \u7684\u8bf7\u6c42\u53c2\u6570\uff0c\u89e3\u6790\u89c4\u5219\uff0ctoken \u673a\u5236\u7b49\u5b8c\u5168\u4e0d\u4e00\u6837\uff0c\u6240\u4ee5\u5728\u5927\u591a\u6570 App \u5f00\u53d1\u4e2d\uff0c\u524d\u540e\u53f0 Http \u8bf7\u6c42\u7684\u5b9e\u73b0\u90fd\u662f\u5f00\u53d1\u8005\u81ea\u5df1\u5c01\u88c5\u7684\u3002<\/p>\n<p><strong>\u5c01\u88c5\u4e00\u4e2a\u524d\u540e\u53f0 Http \u8bf7\u6c42\u5b9e\u73b0\u9700\u8981\u591a\u4e45\uff1f<\/strong><\/p>\n<p>\u53ef\u80fd\u6709\u4eba\u56de\u7b54\u662f 1 \u5c0f\u65f6\uff0c\u4e5f\u6709 3 \u30015 \u5c0f\u65f6\u751a\u81f3\u66f4\u957f\u65f6\u95f4\u7684\uff0c\u6216\u8005\u4e5f\u6709\u8bf4\u5148\u8fd9\u6837\u5c01\u88c5\u4e2a\u5927\u6982\uff0c\u7b49\u5230\u9700\u6c42\u4e0d\u6ee1\u8db3\u7684\u65f6\u5019\u518d\u6539\u3002<\/p>\n<p>\u82b1\u8d39 1 \u5c0f\u65f6\u7684\u65f6\u95f4\u4e0d\u4e00\u5b9a\u77ed\uff0c\u82b1\u8d39 3 \u30015 \u7684\u65f6\u95f4\u4e5f\u4e0d\u4e00\u5b9a\u7b97\u957f\uff0c\u5177\u4f53\u8981\u770b\u524d\u540e\u53f0\u4ea4\u4e92\u7684\u590d\u6742\u7a0b\u5ea6\u4e0e\u5f00\u53d1\u8005\u5bf9\u4ea4\u4e92\u5b9e\u73b0\u7684\u5c01\u88c5\u7a0b\u5ea6\u3002<\/p>\n<p>\u90a3\u8fd9\u91cc\u6211\u4eec\u5c31\u5f15\u51fa\u4e86\u4e00\u4e2a\u95ee\u9898\u4e86\uff0c\u6211\u4eec\u901a\u5e38\u8bf4\u7684 app \u7684 Http \u8bf7\u6c42 [\u5c01\u88c5] \uff0c\u5230\u5e95\u5c01\u88c5\u7684\u662f\u4ec0\u4e48\uff0c\u6211\u4eec\u9700\u8981\u505a\u54ea\u4e9b\u5de5\u4f5c\uff0c\u80fd\u4f7f\u7528\u5f97 app \u7684\u63a5\u53e3\u8bf7\u6c42\u66f4\u7b80\u5355\uff0c\u6613\u7528\u4e14\u6709\u8f83\u9ad8\u7684\u7075\u6d3b\u6027\uff1f\u5728\u6211\u770b\u6765\u8fd9\u4e2a\u201c\u5c01\u88c5\u201d\u4e3b\u8981\u5206\u4e24\u4e2a\u90e8\u5206\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u6570\u636e\u4ea4\u6362 \u5c42\u9762\u7684\u5c01\u88c5\uff0c\u5373\uff1a<\/strong><\/p>\n<ul>\n<li>\u5b9e\u73b0\u524d\u540e\u53f0\u7684\u4e92\u901a\uff0c\u652f\u6301\u670d\u52a1\u5668\u8981\u6c42\u7684\u6570\u636e\u4ea4\u6362\u7c7b\u578b\u3001\u683c\u5f0f\u7b49<\/li>\n<li>\u8c03\u7528\u8005\u53ef\u4ee5\u81ea\u7531\u8bbe\u7f6e\u8bf7\u6c42\u7684 header \u3001params \u7b49\u53c2\u6570\uff0c\u7a0b\u5e8f\u6839\u636e\u4e0d\u540c\u7684\u8bbe\u7f6e\u4e5f\u80fd\u4fdd\u8bc1\u8bf7\u6c42\u80fd\u6b63\u786e\u7684\u53d1\u9001\u7ed9\u670d\u52a1\u7aef\u5e76\u8fd4\u56de\u76f8\u5e94\u7684\u7ed3\u679c<\/li>\n<li>\u652f\u6301\u8d85\u65f6\u3001\u65e5\u5fd7\u6253\u5370\u7b49\u4e00\u4e9b\u57fa\u672c\u529f\u80fd<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u4e1a\u52a1\u903b\u8f91 \u5c42\u9762\u7684\u5c01\u88c5\uff0c\u5373\uff1a<\/strong><\/p>\n<ul>\n<li>\u5165\u53c2\uff1a\u516c\u5171\u90e8\u5206 header \u3001params \u7684\u53c2\u6570\u5904\u7406\uff0c\u907f\u514d\u5728\u5177\u4f53\u63a5\u53e3\u8bf7\u6c42\u662f\u4f20\u5165\u4e0d\u5fc5\u8981\u4e0e\u63a5\u53e3\u65e0\u5173\u7684\u53c2\u6570<\/li>\n<li>\u51fa\u53c2\uff1a\u5bf9\u540e\u53f0\u8fd4\u56de\u7684\u6570\u636e\u6309\u7ea6\u5b9a\u597d\u7684\u89c4\u5219\u505a\u4e00\u5c42\u57fa\u7840\u89e3\u6790\u5904\u7406\uff0c\u907f\u514d\u5728\u5177\u4f53\u63a5\u53e3\u6570\u636e\u89e3\u6790\u7684\u65f6\u5019\u505a\u4e00\u4e9b\u65e0\u610f\u4e49\u7684\u64cd\u4f5c<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><strong>\u4ece\u6295\u5165\u7684\u65f6\u95f4\u4e0a\u6765\u770b\uff1a<\/strong> \u7b2c\u4e00\u90e8\u5206\u57fa\u672c\u4e0a\u8981\u82b1\u6389\u5f00\u53d1\u8005 80%\u4ee5\u4e0a\u7684\u65f6\u95f4\u6765\u5c01\u88c5 \u7b2c\u4e8c\u90e8\u5206\u9700\u8981\u6d88\u8017\u7684\u65f6\u95f4\u53ef\u80fd\u4e0d\u8db3 20% ** [\u4ee5\u6b64\u63a8\u7b97\uff0c\u6309\u4e0a\u9762 1 \u4e2a\u5c0f\u65f6\u7684\u5c01\u88c5\u65f6\u95f4\uff0c\u7528\u5728\u903b\u8f91\u5c01\u88c5\u90e8\u5206\u7684\u65f6\u95f4\u4e5f\u5c31 12 \u5206\u949f\u5de6\u53f3      <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>2<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1504173\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wudalang123 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bf4\u7684\u65f6\u5019\u5e94\u8be5\u4e3e\u51fa\u4e00\u4e2a\u5177\u4f53\u5e94\u7528\u5b9e\u4f8b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1504174\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : rufeng008 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6587\u4e2d\u6709\u793a\u4f8b\u9879\u76ee\uff1a https:\/\/github.com\/chende008\/HttpTestDemo                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u4e8c\u5341\u5206\u949f\u5c01\u88c5\uff0c\u4e00\u4e2a App \u524d\u540e\u53f0&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\/85926"}],"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=85926"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/85926\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=85926"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=85926"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=85926"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}