composer require "guzzlehttp/guzzle:~6.3"
$client=new GuzzleHttp\Client();
//发送请求
$response=$client->get('http://httpbin.org/get');
$response=$client->delete('http://httpbin.org/delete');
$response=$client->head('http://httpbin.org/head');
$response=$client->options('http://httpbin.org/options');
$response=$client->patch('http://httpbin.org/patch');
$response=$client->post('http://httpbin.org/post');
$response=$client->put('http://httpbin.org/put');
//处理响应
$code=$response->getStatusCode();//获取状态码
$reason=$response->getReasonPhrase();//获取原因短语
$response->getHeader('Content-Type');//获取某个首部字段的值
$response->getHeaders();//获取所有首部字段
$response->getBody();//获取响应主体
$response->getBody()->getContents();//获取响应内容