You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
649 B
PHP
26 lines
649 B
PHP
<?php
|
|
|
|
namespace Engelsystem\Http;
|
|
|
|
use Engelsystem\Container\ServiceProvider;
|
|
use GuzzleHttp\Client as GuzzleClient;
|
|
|
|
class HttpClientServiceProvider extends ServiceProvider
|
|
{
|
|
public function register()
|
|
{
|
|
$this->app->when(GuzzleClient::class)
|
|
->needs('$config')
|
|
->give(
|
|
function () {
|
|
return [
|
|
// No exception on >= 400 responses
|
|
'http_errors' => false,
|
|
// Wait max n seconds for a response
|
|
'timeout' => 2.0,
|
|
];
|
|
}
|
|
);
|
|
}
|
|
}
|