fillup/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.

Maintainers

👁 fillup

Package info

github.com/fillup/guzzle-services

pkg:composer/fillup/guzzle-services

Statistics

Installs: 8 321

Dependents: 7

Suggesters: 0

Stars: 0

0.5.1 2016-11-04 16:51 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

MIT 797bbb5bec643a5483a2a227f7da00ebf8607e0e

This package is auto-updated.

Last update: 2026-06-06 14:06:21 UTC


README

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([
 'baseUrl' => '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

This project can be installed using Composer. Add the following to your composer.json:

{
 "require": {
 "guzzlehttp/guzzle-services": "0.5.*"
 }
}

Plugins

More documentation coming soon.