Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

reduced default guzzle set up #19

Merged
merged 1 commit into from
Dec 17, 2015
Merged

reduced default guzzle set up #19

merged 1 commit into from
Dec 17, 2015

Conversation

dbu
Copy link
Contributor

@dbu dbu commented Dec 16, 2015

set up guzzle client as very minimal, not throwing exceptions for HTTP status codes, not following redirects, not handling cookies

fix #13

…P status codes, not following redirects, not handling cookies
$this->client = $client ?: new Client();
if (!$client) {
$handlerStack = new HandlerStack();
$handlerStack->push(Middleware::prepareBody(), 'prepare_body');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per #13, we keep the prepareBody functionality. contrary to redirect, exception and cookie, it does not change behaviour and there is no reason to not want this. also, if we add php-http plugins that handle content-length, this middleware realizes the value is already set and leaves things alone.

@sagikazarmark
Copy link
Member

👍

1 similar comment
@joelwurtz
Copy link
Member

👍

joelwurtz added a commit that referenced this pull request Dec 17, 2015
@joelwurtz joelwurtz merged commit 9f58018 into master Dec 17, 2015
@dbu dbu deleted the fix-guzzle-setup branch December 22, 2015 12:22
@kbond
Copy link

kbond commented Dec 22, 2015

This is actually causing me a problem. Guzzle6HttpAdapter::sendRequest() is returning null. When I look deeper into it, I see the guzzle promise is an instance of GuzzleHttp\Promise\RejectedPromise with reason: "No handler has been specified".

When I revert this change, it works as expected.

@sagikazarmark
Copy link
Member

Fix is on it's way

@sagikazarmark
Copy link
Member

@kbond can you try this fix: #21?

sagikazarmark added a commit that referenced this pull request Dec 22, 2015
Fix No handler specified issue introduced in #19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

how to set up guzzle
4 participants