1use Illuminate\Support\Facades\Http;
2
3$response = Http::get('http://example.com');
4
5// The get method returns an instance of Illuminate\Http\Client\Response,
6// which provides a variety of methods that may be used to inspect the response:
7$response->body() : string;
8$response->json() : array|mixed;
9$response->collect() : Illuminate\Support\Collection;
10$response->status() : int;
11$response->ok() : bool;
12$response->successful() : bool;
13$response->failed() : bool;
14$response->serverError() : bool;
15$response->clientError() : bool;
16$response->header($header) : string;
17$response->headers() : array;
1$client = new GuzzleHttp\Client();
2$res = $client->get('https://api.github.com/user', ['auth' => ['user', 'pass']]);
3echo $res->getStatusCode(); // 200
4echo $res->getBody(); // { "type": "User", ....