Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

larvel make http request

// To make requests, you may use the get, post, put, patch, and delete methods
// provided by the Http facade.

use IlluminateSupportFacadesHttp;

$response = Http::get('http://example.com');

// The get method returns an instance of IlluminateHttpClientResponse,
// which provides a variety of methods that may be used to inspect the response:
$response->body() : string;
$response->json() : array|mixed;
$response->collect() : IlluminateSupportCollection;
$response->status() : int;
$response->ok() : bool;
$response->successful() : bool;
$response->failed() : bool;
$response->serverError() : bool;
$response->clientError() : bool;
$response->header($header) : string;
$response->headers() : array;
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #larvel #http #request
ADD COMMENT
Topic
Name
2+4 =