Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Guzzle Services Laravel Package

guzzlehttp/guzzle-services

Build SDK-style API clients with service descriptions: map named operations and parameters to HTTP requests and transform responses into result data, instead of hand-writing request serializers for every endpoint.

View on GitHub
Deep Wiki
Context7

Guzzle Services

guzzlehttp/guzzle-services builds service-description-driven clients on top of guzzlehttp/command. A service description maps named operations and parameters to HTTP requests, then maps responses into result data.

Use this package when you are building an SDK-style client for an API and want operations described in arrays instead of hand-writing every request serializer. If you only need to send HTTP requests directly, install guzzlehttp/guzzle instead.

Installation

composer require guzzlehttp/guzzle-services

Version Guidance

Version Status PHP Version
2.0 Latest >=7.4,<8.7
1.7 Maintenance >=7.2.5,<8.7

Quick Start

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

$description = new Description([
    'baseUri' => 'https://api.example.com',
    'operations' => [
        'getUser' => [
            'httpMethod' => 'GET',
            'uri' => '/users/{id}',
            'responseModel' => 'user',
            'parameters' => [
                'id' => ['type' => 'string', 'location' => 'uri'],
            ],
        ],
    ],
    'models' => [
        'user' => [
            'type' => 'object',
            'additionalProperties' => ['location' => 'json'],
        ],
    ],
]);

$client = new GuzzleClient(new Client(), $description);
$result = $client->getUser(['id' => '123']);

Documentation

Security

If you discover a security vulnerability within this package, please send an email to [email protected]. 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 for more information.

License

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

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
alphabalex/messaging-made-easy
rawphp/warp
shootkiran/merobug
narakode/fineauth
numencode/wn-syncops-plugin
ibnnajjaar/mib-global-pay
ably/pubsub-server
mstfkhazaal/defender
mfonte/base62x
karnoweb/metapilot
tobya/bcsapiwrapper
swalker2/cpanel
vish4395/laravel-translation-manager
morningtrain/economic
teksite/systeminfo-laravel
atomcms/voting
run6/weather
siokas/laravelembeddirectives
adamlien/pkuuids
gilsonsouza/lara-doc-generator