PHPackages                             aymdev/api-client-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. aymdev/api-client-bundle

ActiveSymfony-bundle

aymdev/api-client-bundle
========================

Symfony bundle extending the HttpClient component with extra features (authentication, caching, DTOs, ...)

00PHP

Since Aug 27Pushed 8mo agoCompare

[ Source](https://github.com/AymDev/ApiClientBundle)[ Packagist](https://packagist.org/packages/aymdev/api-client-bundle)[ RSS](/packages/aymdev-api-client-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

API Client Bundle
=================

[](#api-client-bundle)

A **PHP 8.3+** &amp; **Symfony 5 / 6 / 7** bundle extending the **Symfony HttpClient** component with extra features: authentication, caching, DTOs, ...

[![Testing](https://github.com/AymDev/ApiClientBundle/workflows/Testing/badge.svg)](https://github.com/AymDev/ApiClientBundle/workflows/Testing/badge.svg)[![Coding Standards](https://github.com/AymDev/ApiClientBundle/workflows/Coding%20Standards/badge.svg)](https://github.com/AymDev/ApiClientBundle/workflows/Coding%20Standards/badge.svg)[![Bundle installation](https://github.com/AymDev/ApiClientBundle/workflows/Bundle%20installation/badge.svg)](https://github.com/AymDev/ApiClientBundle/workflows/Bundle%20installation/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/9ad7f98b1891a56024a07f137f08a59339a2387383425623f48151682a21174b/68747470733a2f2f706f7365722e707567782e6f72672f61796d6465762f6170692d636c69656e742d62756e646c652f76)](//packagist.org/packages/aymdev/api-client-bundle)[![License](https://camo.githubusercontent.com/0e0c2c6ed5b2c85ae63caf1d8a880a9cd2fae2362f719ca225070063f853a4de/68747470733a2f2f706f7365722e707567782e6f72672f61796d6465762f6170692d636c69656e742d62756e646c652f6c6963656e7365)](//packagist.org/packages/aymdev/api-client-bundle)

> This bundle is a *work in progress* and should get a stable release soon.

- [Why this bundle](#why-this-bundle)
- [Usage](#usage)
- [Request ID](#request-id)
- [Logging](#logging)
    - [Request/Response body logging](#requestresponse-body-logging)
- [Cache](#cache)
- [Response validation](#response-validation)

Why this bundle
===============

[](#why-this-bundle)

The **Symfony HttpClient** component is a very powerful component but you can write the same code over and over if you want to make it work with authentication, DTOs, caching, etc.

This bundle extends the **HttpClient** component and offers features through the `user_data` option key in your requests. All you need to know are the features described in this documentation and the official [HttpClient documentation](https://symfony.com/doc/current/http_client.html) !

Usage
=====

[](#usage)

Install the bundle with **Composer**:

```
composer require aymdev/api-client-bundle
```

Configure it depending on the features you want to use by creating a **aymdev\_api\_client.yaml** file:

```
aymdev_api_client:
    # enable features
```

Fetch the service using the `AymDev\ApiClientBundle\Client\ApiClientInterface` and use its constants in the `user_data`options of your requests:

```
