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

Feature/plugins doc #76

Merged
merged 5 commits into from
Jan 27, 2016
Merged

Feature/plugins doc #76

merged 5 commits into from
Jan 27, 2016

Conversation

joelwurtz
Copy link
Member

No description provided.

[$contentLengthPlugin]
);

One of the main advantage of using this plugin, is when you want to transfer information from an existing stream
Copy link
Member

Choose a reason for hiding this comment

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

This plugin is useful when you want....

@sagikazarmark
Copy link
Member

👍

I would recommend waiting for some input from @dbu as well, he usually has good points about docs (as well 😛 )

@@ -1,4 +1,38 @@
Content-Length Plugin
=====================

TODO
The Content-Length Plugin allows you to make your HTTP Request compliant with most of the servers.
It's main purpose is to set the correct `Content-Length` Header value based on your stream size.
Copy link
Contributor

Choose a reason for hiding this comment

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

The ContentLenghtPlugin sets the correct Content-Length header value based on the size of the body stream of the request. This helps HTTP servers to handle the request.

@dbu
Copy link
Contributor

dbu commented Jan 21, 2016

thanks a lot for the work, joel! i added some feedback. update as much as you feel like, then lets merge. i can also do a follow up PR with further tweaks if you don't want to adress all of it, better have some documentation than none at all.

@joelwurtz
Copy link
Member Author

Will try to implement all remarks by the end of the week. Wanted to add the other plugins also, but will do that in another PR

@@ -1,4 +1,35 @@
Content-Length Plugin
=====================

TODO
The `ContentLengthPlugin` sets the correct `Content-Length` header value based on the size of the body stream of the
Copy link
Contributor

Choose a reason for hiding this comment

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

in .rst, you need double backticks for code, single backticks won't work. (needs to be fixed in all places, won't repeat it everywhere ,-) )

);


This plugin only collect data after resolution, for logging purpose it's best to use the `LoggerPlugin` which logs
Copy link
Contributor

Choose a reason for hiding this comment

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

This plugin collects data only after the request resolution. For logging purposes, ...

You can also use the decoder plugin to decode only the `Transfer-Encoding` header and not the `Content-Encoding` one
by setting the first parameter of the constructor to false::

$decoderPlugin = new DecoderPlugin(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

with php-http/plugins#45 this is now ['use_content_encoding' => false]

@dbu dbu mentioned this pull request Jan 25, 2016
@joelwurtz joelwurtz changed the title [WIP] Feature/plugins doc Feature/plugins doc Jan 26, 2016
@joelwurtz
Copy link
Member Author

Some last review ?

@@ -1,4 +1,17 @@
Cookie Plugin
=============

TODO: explain the cookie plugin
The ``CookiePlugin`` allow you to store cookies information in a ``CookieJar`` and reuse them on consequent requests according
Copy link
Contributor

Choose a reason for hiding this comment

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

‘store cookies’ (no ‘information’)

@ddeboer
Copy link
Contributor

ddeboer commented Jan 27, 2016

@joelwurtz Good job! Can you please wrap at 80 chars? That’s what we’re doing elsewhere in the docs as well (and is according to PHP coding standards, so easy to remember).

@joelwurtz
Copy link
Member Author

Should be ready to merge

@ddeboer
Copy link
Contributor

ddeboer commented Jan 27, 2016

Please squash. 😉

@joelwurtz
Copy link
Member Author

I squash with one commit per documentation file

ddeboer added a commit that referenced this pull request Jan 27, 2016
@ddeboer ddeboer merged commit c044a92 into master Jan 27, 2016
@ddeboer ddeboer deleted the feature/plugins-doc branch January 27, 2016 20:48
@ddeboer
Copy link
Contributor

ddeboer commented Jan 27, 2016

Thanks, Joel! 😄

@joelwurtz
Copy link
Member Author

Build seems to have failed on readthedocs any idea ?

@sagikazarmark
Copy link
Member

Restarted the build, it was an API error

shulard pushed a commit to shulard/documentation that referenced this pull request Feb 18, 2016
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

Successfully merging this pull request may close these issues.

4 participants