Http guzzle request with no response

只谈情不闲聊 提交于 2020-01-25 07:15:46

问题


In my Lumen project, I needed to use the Guzzle client to send requests from the server side to create acces tokens and provide them to the correctly authentified users. The problem is that whenener I send a guzzlehttp request I get no response, using Postmen to send them and request stops just because of the time out.

I tried simple example in the web.php file:

<?php
use GuzzleHttp\Client;

$app->get('/', function () use ($app) {
    //return $app->version();
    $http= new Client();
    return json_decode($http->get('localhost:8088/user'));

});

and when I excute it using the Lumen integrated server I get this: no end request

Please help with this.


回答1:


After I searched about the problem, someone told me that Those requests don't work in the local server, so I tried Xampp and it worked perfectly.



来源:https://stackoverflow.com/questions/48960618/http-guzzle-request-with-no-response

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!