Laravel 使用 guzzle 的请求没有响应

Laravel request using guzzle does not respond

这很好用: screenshot insomnia

但是当我尝试通过 api 路线(POST http://127.0.0.1:8000/api/login 也使用 Insomnia)做同样的事情时,它正确地导致了这个登录功能,我没有得到回应。我设置了超时来结束请求,否则它会在 get-request 中保留 'looping'。为什么这不起作用?

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use GuzzleHttp\Client;

class AuthController extends Controller
{
    public function login(Request $request)
    {
        $client = new Client([
            'timeout'  => 8.0,
        ]);
        $response = $client->get('http://127.0.0.1:8000/api/all');

        return response()->json($response);
    }

}

'nested requests' 无法使用 php artisan 服务。我用 xampp/apache 设法 运行 这段代码。另见 https://laracasts.com/discuss/channels/laravel/api-call-not-returning-a-response