guzzle / command Goto Github PK
View Code? Open in Web Editor NEWProvides the foundation for building web service clients with Guzzle
License: MIT License
Provides the foundation for building web service clients with Guzzle
License: MIT License
If so can we get a composer.json update and a version bump? Anyone using guzzle-services which requires this seems to be stuck using Guzzle ~5.0
Event listeners are attached to the client to handle creating HTTP requests for a command, processing HTTP responses into a result (typically a
GuzzleHttp\Command\ModelInterface
)
It sounds like a good idea, but I don't see this interface in the repository.
The batch method is not included in the AbstractClient in 0.4.0
.
Any chance we can tag the most recent code?
Example: server replies to my request with a code 409 HTTP error.
The following code prints 0 instead of 409.
try {
$response = $guzzleClient->execute($command);
} catch (\GuzzleHttp\Command\Exception\CommandClientException $e) {
echo $e->getCode();
}
For example \GuzzleHttp\Exception\ClientException 's code is the HTTP code.
Am I missing something?
Hello,
I'm trying to use guzzle/guzzle-services with guzzle 6, but the fact that guzzle/guzzle-services require guzzle/command and that guzzle command require guzzle "~5.0" makes it complicate (impossible) and I get stuck with guzzle 5.3.
How to reproduce:
$ composer require guzzlehttp/guzzle
Using version ^6.1 for guzzlehttp/guzzle
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Writing lock file
Generating autoload files
$ composer require guzzlehttp/guzzle-services
Using version ^0.5.0 for guzzlehttp/guzzle-services
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- guzzlehttp/command 0.7.1 requires guzzlehttp/guzzle ~5.0 -> no matching package found.
- guzzlehttp/command 0.7.0 requires guzzlehttp/guzzle ~5.0 -> no matching package found.
- guzzlehttp/guzzle-services 0.5.0 requires guzzlehttp/command 0.7.* -> satisfiable by guzzlehttp/command[0.7.0, 0.7.1].
- Installation request for guzzlehttp/guzzle-services ^0.5.0 -> satisfiable by guzzlehttp/guzzle-services[0.5.0].
Potential causes:
Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
Installation failed, reverting ./composer.json to its original content.
Thanks in advance
I'm trying to use this functionality as a basis for an API library.
Is there documentation for the best way to use/implement it? IE. new CurrindaAPIService
which sets up all endpoints etc?
Hi,
In Guzzle 3, I had listeners to catch events, and throw business specific exceptions. For instance, this was the list of exceptions: https://github.com/zf-fr/zfr-mailchimp/tree/v2.0.5/src/ZfrMailChimp/Exception
And I had a listener that used to inspect the response and trigger those exceptions: https://github.com/zf-fr/zfr-mailchimp/blob/v2.0.5/src/ZfrMailChimp/Client/Listener/ErrorHandlerListener.php
However, I can't make work that on Guzzle 4. My new listener looks like that: https://github.com/zf-fr/zfr-mailchimp/blob/master/src/ZfrMailChimp/Client/Listener/ErrorHandlerListener.php
But Guzzle always wrap my own exception around a RequestException (first), and wrap again around a CommandException. Therefore, this prevents me from catching the MailChimp specific exceptions.
How can I force Guzzle NOT TO wrap my exceptions emitted in the listener?
Thanks!
guzzle-services requires new classes from this package. Can we have a new tag or branch alias?
Correct me if i am wrong but as far as i read documentation i am not able to understand how $client
is able to interact with $command
?.
$client
HTTP response is passed to $command
?$client
do all validation stuffs and when all things passes then $command
will be executed?Hi,
There is no documentation how to get the response, http code and more. Is there possible to add it ?
Hello,
Could you please explain a bit how to migrate from 0.8 to 0.9 to replace Event system please?
EDIT
I suppose I can find the answer here
It looks like event listeners for the executeAll()
method are hard-coded to -9999 (see https://github.com/guzzle/command/blob/master/src/CommandToRequestIterator.php). What is the reason for this and should we make this more flexible?
The readme is lacking a documentation for instantiation of the client. For now I got inspired by the unit tests but for some reasons I will receive a 400 Bad Request
while sending form encoded params to an URL.
Maybe it does make sense - since it contains a breaking changes - to release it as 1.0.0.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.