{"id":88865,"date":"2019-07-25T02:37:51","date_gmt":"2019-07-24T18:37:51","guid":{"rendered":"http:\/\/4563.org\/?p=88865"},"modified":"2019-07-25T02:37:51","modified_gmt":"2019-07-24T18:37:51","slug":"php-%e4%bd%bf%e7%94%a8-guzzlehttp-%e4%b8%8d%e8%83%bd%e8%8e%b7%e5%8f%96%e5%ae%8c%e6%95%b4%e7%9a%84%e5%93%8d%e5%ba%94%e5%86%85%e5%ae%b9%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=88865","title":{"rendered":"PHP \u4f7f\u7528 GuzzleHttp \u4e0d\u80fd\u83b7\u53d6\u5b8c\u6574\u7684\u54cd\u5e94\u5185\u5bb9\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  PHP \u4f7f\u7528 GuzzleHttp \u4e0d\u80fd\u83b7\u53d6\u5b8c\u6574\u7684\u54cd\u5e94\u5185\u5bb9\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : s609926202 <\/span>  <span><i><\/i> 43<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u540c\u4e00\u4e2a\u63a5\u53e3\uff0c\u76f4\u63a5\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u7684\u54cd\u5e94\u5185\u5bb9\u662f\uff1a<\/p>\n<p>{a: [], b: true, c: false}<\/p>\n<p>\u4f7f\u7528 GuzzleHttp \u83b7\u53d6\u7684\u54cd\u5e94\u5185\u5bb9\u662f\uff08 json_decode($response-&gt;getBody()-&gt;getContents()))\uff1a<\/p>\n<p>{b: true}<\/p>\n<p>\u53ef\u4ee5\u770b\u5230\u51e1\u662f\u503c\u4e3a\u7a7a\u6216\u8005 false \u7684\u90fd\u88ab\u8fc7\u6ee4\u6389\u4e86\u3002\u6240\u4ee5\u5982\u4f55\u83b7\u53d6\u5b8c\u6574\u7684\u54cd\u5e94\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"572564\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dobelee <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u662f\u4e0d\u662f\u52a0\u4e86\u4ec0\u4e48\u8fc7\u6ee4\uff1f\u4e0d\u8981 decode \u770b\u770b\u5185\u5bb9\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"572565\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : s609926202 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @dobelee \u67e5\u770b getContents()\u540e\u7684\u5185\u5bb9\u4e5f\u662f\u7f3a\u5c11\u503c\u4e3a\u7a7a\u7684\u7ed3\u679c\u3001                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"572566\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lshero <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             $response-&gt;getBody() \u5185\u7f6e\u4e86 tostring \u65b9\u6cd5 \u76f4\u63a5 strval($response-&gt;getBody())                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"572567\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : PHPJit <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6253\u5370 `$response-&gt;getBody()-&gt;getContent()`                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"572568\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : askfilm <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u89c9\u5f97\u95ee\u9898\u5e94\u8be5\u6539\u4e00\u4e0b, &#8220;PHP \u4f7f\u7528 GuzzleHttp \u600e\u6837\u83b7\u53d6\u5b8c\u6574\u7684\u54cd\u5e94\u5185\u5bb9\uff1f&#8221;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>PHP \u4f7f\u7528 GuzzleHttp&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\/88865"}],"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=88865"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/88865\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=88865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=88865"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=88865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}