Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Guzzle 6.5.3 #218

Open
yellow1912 opened this issue May 11, 2020 · 1 comment
Open

Issue with Guzzle 6.5.3 #218

yellow1912 opened this issue May 11, 2020 · 1 comment

Comments

@yellow1912
Copy link

yellow1912 commented May 11, 2020

Hello,

On the latest stable version of Guzzle, the PSR compatible methods are:

send
sendAsync

https://github.com/guzzle/guzzle/blob/aab4ebd862aa7d04f01a4b51849d657db56d882e/src/Client.php#L107

However, on Omni's Client, we are calling sendRequest method:

return $this->httpClient->sendRequest($request);

This will cause the Guzzle client to call the magic __call method which in turn will call the request method instead:

https://github.com/guzzle/guzzle/blob/aab4ebd862aa7d04f01a4b51849d657db56d882e/src/Client.php#L85

https://github.com/guzzle/guzzle/blob/aab4ebd862aa7d04f01a4b51849d657db56d882e/src/Client.php#L180

I'm not sure how this should be handled, perhaps we check for guzzle's version? Or check for Guzzle's class and the presence of the method sendRequest?

@barryvdh
Copy link
Member

PSR-18 (https://www.php-fig.org/psr/psr-18/) defines the sendRequest method, which is used by us. It seems that only Guzzle 7 will support PSR-18 directly, for Guzzle 6 the adapter is used: http://docs.php-http.org/en/latest/clients/guzzle6-adapter.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants