This package is abandoned and no longer maintained. The author suggests using the setono/request-aware-http-client package instead.

A Symfony bundle that decorates the http client with request logging

Installs: 6 691

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0


v0.2.0 2022-06-09 08:37 UTC

This package is auto-updated.

Last update: 2022-09-16 08:28:15 UTC


Latest Version Software License Build Status


This bundle will decorate Symfonys HTTP client and make it possible to retrieve full requests for debugging etc.


Step 1: Download

$ composer require setono/http-client-bundle

Step 2: Enable the bundle

If you use Symfony Flex it will be enabled automatically. Else you need to add it to the config/bundles.php:

// config/bundles.php

return [
    // ...

    Setono\HttpClientBundle\SetonoHttpClientBundle::class => ['all' => true],

    // ...


Right now you manually decorate your HTTP client. In the future this will be done automatically for you.

use Setono\HttpClientBundle\HttpClient\RequestAwareHttpClient;
use Setono\HttpClientBundle\HttpClient\RequestAwareHttpClientInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;

class YourService
    private RequestAwareHttpClientInterface $httpClient;
    public function __construct(HttpClientInterface $httpClient)
        $this->httpClient = new RequestAwareHttpClient($httpClient);
    public function doSomething(): void
        $response = $this->httpClient->request('POST', '', [
            'json' => ['name' => 'John Doe']

        $request = $this->httpClient->getRequestFromResponse($response);

        echo $request->asString();
        // Outputs:
        // POST {"name":"John Doe"}