社区有关于GuzzleHttp的教程吗?

JellyBool

暂时还没有,。。

假如_丶 回复 JellyBool

可否录一个…

JellyBool 回复 假如_丶

这个需要有排期

假如_丶 回复 JellyBool

那我直接问你问题吧~哈哈哈哈…

大概是这个样子我在本地搭建了一个项目,恩

// url:http://localhost:8000/

use GuzzleHttp\Client;

 public function authenticate(Request $request)
    {

        $http = new \GuzzleHttp\Client();

        $headers = ['Authorization' => 'Bearer'];

        $client = new \GuzzleHttp\Psr7\Request('POST', 'http://localhost:8000//api/login', [
            'form_params' => [
                'email' => $request->email,
                'password' => $request->password,
            ]
        ]);

        $response = $http->send($client);

        return json_decode((string) $response->getBody(), true);
    }

// http://localhost:8000//api/login 的路由

public function authenticate(Request $request)
    {
        $data['Authorization'] = $request->all();

        return response()->json($data);
    }
// 想要实现 authenticate 这个function把 email,password传给api/login的authenticate然后他获取到 email,password 返回状态,现在返回是空的...没有获取到值,求解...

JellyBool 回复 假如_丶

看报错信息呗。。。。你确定地址是对的吗

假如_丶 回复 JellyBool

地址是对的,我用postman返回token了。
这样写是没有问题的是吗?

daryl

教主可以开放几个录视频的名额给几位dalao= =像Laracast一样= =