-
Notifications
You must be signed in to change notification settings - Fork 56
Add Guzzle 6 adapter docs #67
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
Conversation
Oops wait, I forgot to add an installation section. :lol: |
|
||
use GuzzleHttp\Psr7\Request; | ||
|
||
$request = new Request('GET', 'http://httpbin.org'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we promote this or use the message factory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it rather matters in a library, then an application. I would keep both and state that message factory should be used in a library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to keep things as easy as possible for new users.
And because guzzle6-adapter requires guzzle which requires guzzle/psr7, I thought it made sense to just use Guzzle’s PSR-7 Request object here.
Added a reference to the message factory doc chapter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Wouldn't it end up too much duplicated documentation if we have this in each client documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s a good argument, too. Let’s try to minimize duplication where possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think only the configuration can be different for clients. So every other usage should be the same hence the interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s true, but it makes sense to have complete example per adapter. Later we can extract this duplicated bit and make it an include (long live Sphinx 😉).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool.
9fd919c
to
10c168a
Compare
Installation notes added. Now ready for merging. |
* Learn how you can decouple your code from any PSR-7 implementation (such as | ||
Guzzle’s above) by using a :ref:`message factory <message-factory>`. | ||
|
||
.. _Guzzle 6 HTTP client: http://docs.guzzlephp.org/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer this bottom section over documentation sprinkled with note and warning boxes, as they can be very distracting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
we might want to move this into a partial that we include right away, as this page will be used as template for other adapter / client documentations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s do that in subsequent PRs for the adapters.
Updated according to feedback. |
thanks a lot! |
No description provided.