怎么在laravel中利用with动态添加where条件
1月前
zealov/
Guzzle 是一个 PHP HTTP 客户端,可以轻松发送 HTTP 请求,并且可以轻松地与 Web 服务集成。
$client = new GuzzleHttp\Client(); $res = $client->request('GET', 'https://api.github.com/user', [ 'auth' => ['user', 'pass'] ]); echo $res->getStatusCode(); // "200" echo $res->getHeader('content-type')[0]; // 'application/json; charset=utf8' echo $res->getBody(); // {"type":"User"...' // Send an asynchronous request. $request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org'); $promise = $client->sendAsync($request)->then(function ($response) { echo 'I completed! ' . $response->getBody(); }); $promise->wait();
暂无评论,抢个沙发...