laravel http request get response

Solutions on MaxInterview for laravel http request get response by the best coders in the world

showing results for - "laravel http request get response"
Mariana
15 Apr 2019
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;