手册地址:http://docs.guzzlephp.org/en/stable/request-options.html#headers
Github:https://github.com/guzzle/guzzle
Composer:https://packagist.org/packages/guzzlehttp/guzzle
发送请求
-
use GuzzleHttp\Client;
-
$client = new Client([
-
//跟域名
-
'base_uri' => 'http://localhost/test',
-
// 超时
-
'timeout' => 2.0,
-
]);
-
$response = $client->get('/get'); //http://localhost/get
-
$response = $client->delete('delete'); //http://localhost/get/delete
-
$response = $client->head('http://localhost/get');
-
$response = $client->options('http://localhost/get');
-
$response = $client->patch('http://localhost/patc