PHPackages                             m6web/wsclient-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. [HTTP &amp; Networking](/categories/http)
4. /
5. m6web/wsclient-bundle

Abandoned → [m6web/guzzle-http-bundle](/?search=m6web%2Fguzzle-http-bundle)ArchivedSymfony-bundle[HTTP &amp; Networking](/categories/http)

m6web/wsclient-bundle
=====================

Simple webservices client to call external urls

v5.4.2(10y ago)140.3k2[1 issues](https://github.com/M6Web/WsClientBundle/issues)PHP

Since Mar 4Pushed 10y ago24 watchersCompare

[ Source](https://github.com/M6Web/WsClientBundle)[ Packagist](https://packagist.org/packages/m6web/wsclient-bundle)[ RSS](/packages/m6web-wsclient-bundle/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (9)Dependencies (8)Versions (28)Used By (0)

this bundle is deprecated
=========================

[](#this-bundle-is-deprecated)

usage of  is recommended

Bundle WSClient [![Build Status](https://camo.githubusercontent.com/5131ca52e46f616a5a76fc4ba0ff54e1468c2035e33ca2d0a712c80da44e5c2e/68747470733a2f2f7472617669732d63692e6f72672f4d365765622f5773436c69656e7442756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/M6Web/WsClientBundle)
===========================================================================================================================================================================================================================================================================================================

[](#bundle-wsclient-)

This bundle give a simple webservices client to call external urls. By default, it is based on Guzzle but you can plug any other client library.

Services
--------

[](#services)

No default service is defined. You must set a configuration to instanciate one or more services.

Configuration
-------------

[](#configuration)

The main configuration key is `m6_ws_client`. Each subkey defines an instance of a webservice client. These services are named `m6_ws_client_` + the subkey except for the `default` subkey that defines the main service `m6_ws_client`. For each instance, several parameters can be set :

- `base_url` : the base domain of each url called with the service. If an absolute url is passed to the client, the base url is ignored.
- `config` (optional) : additional parameters to configure the client, must be an array. See
- `cache` (optional) :
    - `ttl` : 86400s by default. Max ttl if force\_request\_ttl is FALSE, forced ttl if force\_request\_ttl is TRUE
    - `force_request_ttl` (optional) : FALSE by default. If TRUE, request TTL is the same than the cache TTL, otherwise the request TTL is calculated according to response headers.
    - `service` : low level cache service (must implement M6Web\\Bundle\\WSClientBundle\\Cache\\CacheInterface)
    - `adpater` : adapter class name (must implement \\Doctrine\\Common\\Cache\\Cache)
    - storage : (optional) storage class name (must implement \\GuzzleHttp\\Subscriber\\Cache\\CacheStorageInterface)
    - subscriber : (optional) subscriber class (must implement \\GuzzleHttp\\Subscriber\\Cache\\SubscriberInterface)
    - can\_cache : (optional) a callable to determine if a request can be cached

Here is an example of a simple configuration :

```
m6_ws_client:
    clients:
        default:
            base_url: 'toto.m6web.fr'
            config:
                timeout: 10
                allow_redirects: {max: 5, strict: false, referer: true}
                exceptions: false
            cache:
                ttl: 3600
                adapter: M6\Bundle\RedisBundle\Guzzle\RedisCacheAdapter
                service: m6_redis
```

Simple use case
---------------

[](#simple-use-case)

For instance, in a controller :

```
$wsclient = $this->get('m6_ws_client');
$response = $wsclient->get('http://toto.m6web.fr/parse/?content=my_content');

echo $response->getBody();
```

unit test
---------

[](#unit-test)

```
composer install --dev
./bin/atoum
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~21 days

Recently: every ~12 days

Total

23

Last Release

3987d ago

Major Versions

v1.0.1 → v2.0.02014-04-16

v2.0.5 → v3.0.02014-06-04

v3.0.0 → v4.0.02014-07-07

v4.1.1 → v5.0.02014-09-29

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2069361?v=4)[Patrick](/maintainers/Bedrock)[@Bedrock](https://github.com/Bedrock)

![](https://www.gravatar.com/avatar/4f041a1974dbc19c70e199fb278d9b9026409999444087c7efbd1cb249a49f3a?d=identicon)[omansour](/maintainers/omansour)

---

Top Contributors

[![omansour](https://avatars.githubusercontent.com/u/1131098?v=4)](https://github.com/omansour "omansour (17 commits)")[![AntoineReneleau](https://avatars.githubusercontent.com/u/2729394?v=4)](https://github.com/AntoineReneleau "AntoineReneleau (14 commits)")[![mikaelrandy](https://avatars.githubusercontent.com/u/187703?v=4)](https://github.com/mikaelrandy "mikaelrandy (3 commits)")[![fabdsp](https://avatars.githubusercontent.com/u/5878620?v=4)](https://github.com/fabdsp "fabdsp (2 commits)")[![jdlabails](https://avatars.githubusercontent.com/u/8875327?v=4)](https://github.com/jdlabails "jdlabails (1 commits)")[![t-geindre](https://avatars.githubusercontent.com/u/6348039?v=4)](https://github.com/t-geindre "t-geindre (1 commits)")

### Embed Badge

![Health badge](/badges/m6web-wsclient-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/m6web-wsclient-bundle/health.svg)](https://phpackages.com/packages/m6web-wsclient-bundle)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[eightpoints/guzzle-bundle

Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony. Comes with easy and powerful configuration options and optional plugins.

45912.1M55](/packages/eightpoints-guzzle-bundle)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)[php-http/stopwatch-plugin

Symfony Stopwatch plugin for HTTPlug

26721.1M3](/packages/php-http-stopwatch-plugin)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48247.0M384](/packages/php-http-curl-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
