问题
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