// Somewhere in the code
/**
* Since we have defined the base_uri as default option, we can simply make a
* request using only the uri.
*/
$response = Http::get('/baz');
// Somewhere in the code
/**
* The debug option and the basic auth will be used together the default options defined before.
*/
$response = Http::withOptions([
'debug' => 'true'
])->withBasicAuth('username', 'password')->get('/baz');
// Remove all of the default options...
$response = Http::withoutDefaultOptions()->get('https://bar.com');
// Remove some of the global options
$response = Http::withoutDefaultOptions([
'option', 'another-option'
])->get('https://bar.com');
// You can pass options to remove as arguments as well
$response = Http::withoutDefaultOptions('option', 'another-option')->get('https://bar.com');
// If you would like to remove deeply nested options, you may use the the dot notation syntax
$response = Http::withoutDefaultOptions('header.X-Some-Header')->get('https://bar.com');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.