Base Uri
You can specify the base uri using either the withBaseUrl()
method or directly via the driver options, in your config/http-clients.php
. This will result in each request's uri being prefixed, with the stated "base uri"
withBaseUrl()
Via $builder = $client
->withBaseUrl('https://acme.org/api/v1');
Via Configuration
Add the base_uri
in your options
list, to set the base uri.
<?php
return [
'profiles' => [
'default' => [
'driver' => \Aedart\Http\Clients\Drivers\DefaultHttpClient::class,
'options' => [
'base_uri' => 'https://acme.org/api/v1'
]
],
],
// ... remaining not shown ...
];