PHPackages                             guzzlehttp/guzzle-services - 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. guzzlehttp/guzzle-services

ActiveLibrary[HTTP &amp; Networking](/categories/http)

guzzlehttp/guzzle-services
==========================

Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.

1.4.2(1y ago)25410.5M—4.6%80[12 issues](https://github.com/guzzle/guzzle-services/issues)[4 PRs](https://github.com/guzzle/guzzle-services/pulls)20MITPHPPHP ^7.2.5 || ^8.0CI passing

Since Mar 15Pushed 2mo ago19 watchersCompare

[ Source](https://github.com/guzzle/guzzle-services)[ Packagist](https://packagist.org/packages/guzzlehttp/guzzle-services)[ GitHub Sponsors](https://github.com/GrahamCampbell)[ GitHub Sponsors](https://github.com/Nyholm)[ RSS](/packages/guzzlehttp-guzzle-services/feed)WikiDiscussions 1.4 Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (22)Used By (20)

Guzzle Services
===============

[](#guzzle-services)

Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.

```
use GuzzleHttp\Client;
use GuzzleHttp\Command\Guzzle\GuzzleClient;
use GuzzleHttp\Command\Guzzle\Description;

$client = new Client();
$description = new Description([
	'baseUri' => 'http://httpbin.org/',
	'operations' => [
		'testing' => [
			'httpMethod' => 'GET',
			'uri' => '/get{?foo}',
			'responseModel' => 'getResponse',
			'parameters' => [
				'foo' => [
					'type' => 'string',
					'location' => 'uri'
				],
				'bar' => [
					'type' => 'string',
					'location' => 'query'
				]
			]
		]
	],
	'models' => [
		'getResponse' => [
			'type' => 'object',
			'additionalProperties' => [
				'location' => 'json'
			]
		]
	]
]);

$guzzleClient = new GuzzleClient($client, $description);

$result = $guzzleClient->testing(['foo' => 'bar']);
echo $result['args']['foo'];
// bar
```

Installing
----------

[](#installing)

This project can be installed using Composer:

`composer require guzzlehttp/guzzle-services`

For **Guzzle 5**, use `composer require guzzlehttp/guzzle-services:0.6`.

**Note:** If Composer is not installed [globally](https://getcomposer.org/doc/00-intro.md#globally) then you may need to run the preceding Composer commands using `php composer.phar` (where `composer.phar` is the path to your copy of Composer), instead of just `composer`.

Plugins
-------

[](#plugins)

- Load Service description from file \[\]

Transition guide from Guzzle 5.0 to 6.0
---------------------------------------

[](#transition-guide-from-guzzle-50-to-60)

### Change regarding PostField and PostFile

[](#change-regarding-postfield-and-postfile)

The request locations `postField` and `postFile` were removed in favor of `formParam` and `multipart`. If your description looks like

```
[
    'baseUri' => 'http://httpbin.org/',
    'operations' => [
        'testing' => [
            'httpMethod' => 'GET',
            'uri' => '/get{?foo}',
            'responseModel' => 'getResponse',
            'parameters' => [
                'foo' => [
                    'type' => 'string',
                    'location' => 'postField'
                ],
                'bar' => [
                    'type' => 'string',
                    'location' => 'postFile'
                ]
            ]
        ]
    ],
]
```

you need to change `postField` to `formParam` and `postFile` to `multipart`.

More documentation coming soon.

Cookbook
--------

[](#cookbook)

### Changing the way query params are serialized

[](#changing-the-way-query-params-are-serialized)

By default, query params are serialized using strict RFC3986 rules, using `http_build_query` method. With this, array params are serialized this way:

```
$client->myMethod(['foo' => ['bar', 'baz']]);

// Query params will be foo[0]=bar&foo[1]=baz
```

However, a lot of APIs in the wild require the numeric indices to be removed, so that the query params end up being `foo[]=bar&foo[]=baz`. You can easily change the behaviour by creating your own serializer and overriding the "query" request location:

```
use GuzzleHttp\Command\Guzzle\GuzzleClient;
use GuzzleHttp\Command\Guzzle\RequestLocation\QueryLocation;
use GuzzleHttp\Command\Guzzle\QuerySerializer\Rfc3986Serializer;
use GuzzleHttp\Command\Guzzle\Serializer;

$queryLocation = new QueryLocation('query', new Rfc3986Serializer(true));
$serializer = new Serializer($description, ['query' => $queryLocation]);
$guzzleClient = new GuzzleClient($client, $description, $serializer);
```

You can also create your own serializer if you have specific needs.

Security
--------

[](#security)

If you discover a security vulnerability within this package, please send an email to . All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/guzzle-services/security/policy) for more information.

License
-------

[](#license)

Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.

For Enterprise
--------------

[](#for-enterprise)

Available as part of the Tidelift Subscription

The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-guzzle-services?utm_source=packagist-guzzlehttp-guzzle-services&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

###  Health Score

67

—

FairBetter than 100% of packages

Maintenance66

Regular maintenance activity

Popularity66

Solid adoption and visibility

Community52

Growing community involvement

Maturity77

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 ~218 days

Recently: every ~263 days

Total

21

Last Release

74d ago

Major Versions

0.6.0 → 1.0.02016-11-24

PHP version history (4 changes)0.2.0PHP &gt;=5.4.0

1.0.0PHP &gt;=5.5

1.2.0PHP &gt;=7.3

1.3.0PHP ^7.2.5 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/190930?v=4)[Michael Dowling](/maintainers/mtdowling)[@mtdowling](https://github.com/mtdowling)

![](https://www.gravatar.com/avatar/401ccc5eea13c60cf807ae982af00e368e2166e2f26d8eb541dcd881a57385bc?d=identicon)[Nyholm](/maintainers/Nyholm)

![](https://www.gravatar.com/avatar/0e4e105cea62b616d4cb376b08a849b6a428f646998537de150d16a8eb537b90?d=identicon)[mark.sagikazar](/maintainers/mark.sagikazar)

![](https://www.gravatar.com/avatar/d95eb26cb8f3919bb5ca3b6d823daeabbf259663778a970349b245c580713c8e?d=identicon)[graham-campbell](/maintainers/graham-campbell)

---

Top Contributors

[![mtdowling](https://avatars.githubusercontent.com/u/190930?v=4)](https://github.com/mtdowling "mtdowling (44 commits)")[![Konafets](https://avatars.githubusercontent.com/u/363363?v=4)](https://github.com/Konafets "Konafets (36 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (30 commits)")[![bakura10](https://avatars.githubusercontent.com/u/1198915?v=4)](https://github.com/bakura10 "bakura10 (9 commits)")[![jeremeamia](https://avatars.githubusercontent.com/u/107867?v=4)](https://github.com/jeremeamia "jeremeamia (6 commits)")[![cordoval](https://avatars.githubusercontent.com/u/328359?v=4)](https://github.com/cordoval "cordoval (4 commits)")[![sprak3000](https://avatars.githubusercontent.com/u/5545555?v=4)](https://github.com/sprak3000 "sprak3000 (4 commits)")[![igorsantos07](https://avatars.githubusercontent.com/u/532299?v=4)](https://github.com/igorsantos07 "igorsantos07 (2 commits)")[![my2ter](https://avatars.githubusercontent.com/u/52558?v=4)](https://github.com/my2ter "my2ter (2 commits)")[![fuhry](https://avatars.githubusercontent.com/u/1379912?v=4)](https://github.com/fuhry "fuhry (2 commits)")[![mookle](https://avatars.githubusercontent.com/u/164292?v=4)](https://github.com/mookle "mookle (1 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (1 commits)")[![peterfox](https://avatars.githubusercontent.com/u/1716506?v=4)](https://github.com/peterfox "peterfox (1 commits)")[![rfink](https://avatars.githubusercontent.com/u/108414?v=4)](https://github.com/rfink "rfink (1 commits)")[![siwinski](https://avatars.githubusercontent.com/u/1034024?v=4)](https://github.com/siwinski "siwinski (1 commits)")[![stovak](https://avatars.githubusercontent.com/u/119924?v=4)](https://github.com/stovak "stovak (1 commits)")[![sy-records](https://avatars.githubusercontent.com/u/33931153?v=4)](https://github.com/sy-records "sy-records (1 commits)")[![ASA1-ET-JENKINS](https://avatars.githubusercontent.com/u/48315530?v=4)](https://github.com/ASA1-ET-JENKINS "ASA1-ET-JENKINS (1 commits)")[![tianyiw2013](https://avatars.githubusercontent.com/u/4644588?v=4)](https://github.com/tianyiw2013 "tianyiw2013 (1 commits)")[![Bolid1](https://avatars.githubusercontent.com/u/5942653?v=4)](https://github.com/Bolid1 "Bolid1 (1 commits)")

---

Tags

apiguzzleguzzle-serviceshttprest

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/guzzlehttp-guzzle-services/health.svg)

```
[![Health](https://phpackages.com/badges/guzzlehttp-guzzle-services/health.svg)](https://phpackages.com/packages/guzzlehttp-guzzle-services)
```

###  Alternatives

[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[shopify/shopify-api

Shopify API Library for PHP

4634.8M16](/packages/shopify-shopify-api)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[zenditplatform/zendit-php-sdk

PHP client for Zendit API

1204.3k](/packages/zenditplatform-zendit-php-sdk)[huaweicloud/huaweicloud-sdk-php

Huawei Cloud SDK for PHP

1829.2k2](/packages/huaweicloud-huaweicloud-sdk-php)[ory/hydra-client-php

Documentation for all of Ory Hydra's APIs.

1710.8k](/packages/ory-hydra-client-php)

PHPackages © 2026

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