Skip to content

Added a formatter that shows the full header and body of the HTTP message #44

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

Merged
merged 3 commits into from
Jul 4, 2016

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm commented Jul 3, 2016

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets none
Documentation no
License MIT

What's in this PR?

A new formatter that show the full HTTP message. The formatter takes a constructor argument to adjust the length of the body. If the length is set to 0 we would only see the headers. (naturally).

Why?

I will need this formatter in a (WIP) PR on the HTTPlug bundle. I want to show the changes each Plugin does on the request and responses.

Im not sure this formatter belongs here, but I think there is a fairly common use case to be able to see full requests. If it is rejected here I will push it to the HTTPlug repo.

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix

@@ -6,6 +6,9 @@

- #41: Response builder broke header value

### Added
Copy link
Member

Choose a reason for hiding this comment

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

Please keep alphabetic order in the changelog.

@sagikazarmark
Copy link
Member

LGTM, added a few comments.

@dbu dbu merged commit 4e3de15 into php-http:master Jul 4, 2016
@dbu
Copy link
Contributor

dbu commented Jul 4, 2016

thanks tobias, you had a busy weekend!

we might expand this to have a limit on each header as well. headers can technically be very long as well, at least up to 1000 characters. having a limit of 100 or 200 would rarely be hit, but if it is hit it would be relevant to not drown a log in gibberish... but this can be added later if somebody wants to make the effort.

@sagikazarmark
Copy link
Member

Yeah, if we had an MVP, that would be @Nyholm now.

@Nyholm Nyholm deleted the formatter branch July 4, 2016 07:26
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.

3 participants