use GuzzleHttpClient;
$client = new GuzzleHttpClient();$res = $client->request('GET', 'https://api.github.com/user', [
'auth' => ['user', 'pass']
]);echo $res->getStatusCode();
相关分类