HTTP枪口请求,无响应 [英] Http guzzle request with no response

查看:153
本文介绍了HTTP枪口请求,无响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Lumen项目中,我需要使用Guzzle客户端从服务器端发送请求,以创建acces令牌并将其提供给经过正确身份验证的用户. 问题是,当我发送一个耗时的http请求时,我没有响应,使用邮递员发送它们,并且由于超时而停止了请求.

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.

我尝试了web.php文件中的简单示例:

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'));

});

,当我使用Lumen集成服务器对其执行时,得到以下信息: 无最终请求

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

请对此提供帮助.

推荐答案

我搜索了问题之后,有人告诉我那些请求在本地服务器上不起作用,所以我尝试了Xampp,它运行良好.

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.

这篇关于HTTP枪口请求,无响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆