社区有关于GuzzleHttp的教程吗?有的话可否给个链接....
微信里点“发现”,扫一下
二维码便可将本文分享至朋友圈。
暂时还没有,。。
可否录一个…
这个需要有排期
那我直接问你问题吧~哈哈哈哈…
大概是这个样子我在本地搭建了一个项目,恩
// 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 返回状态,现在返回是空的...没有获取到值,求解...
看报错信息呗。。。。你确定地址是对的吗
地址是对的,我用postman返回token了。 这样写是没有问题的是吗?
教主可以开放几个录视频的名额给几位dalao= =像Laracast一样= =