📜  laravel 6 发出 http 请求 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:37.795000             🧑  作者: Mango

代码示例1
$client = new GuzzleHttp\Client();
$res = $client->get('https://api.github.com/user', ['auth' =>  ['user', 'pass']]);
echo $res->getStatusCode(); // 200
echo $res->getBody(); // { "type": "User", ....