Skip to content

Instantly share code, notes, and snippets.

@alcohol
Created April 20, 2021 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alcohol/df5f62f39a3a586fd6bfe62c2672dbfd to your computer and use it in GitHub Desktop.
Save alcohol/df5f62f39a3a586fd6bfe62c2672dbfd to your computer and use it in GitHub Desktop.
Psr18
services:
Symfony\Component\HttpClient\HttpClient: ~
sdk.client.http:
factory: ['@Symfony\Component\HttpClient\HttpClient', 'create']
arguments:
$defaultOptions:
base_uri: '%sdk.endpoint%'
auth_basic: '%sdk.apikey%:%sdk.apisecret%'
timeout: 2
headers:
'User-Agent': 'Client.tld'
sdk.client.psr18:
class: Symfony\Component\HttpClient\Psr18Client
arguments:
- '@sdk.client.http'
Psr\Http\Client\ClientInterface: '@sdk.client.psr18'
Psr\Http\Message\RequestFactoryInterface: '@sdk.client.psr18'
Psr\Http\Message\StreamFactoryInterface: '@sdk.client.psr18'
Sdk\Client:
autowire: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment