发送请求

创建客户端

1
2
3
4
5
6
7
use GuzzleHttp\Client;
$client = new Client([
// Base URI is used with relative requests
'base_uri' => 'http://httpbin.org',
// You can set any number of default request options.
'timeout' => 2.0,
]);

Client对象可以接收一个包含参数的数组: