php-http / message

HTTP Message related tools
http://php-http.org
MIT License
1.29k stars 41 forks source link

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

Closed Nyholm closed 8 years ago

Nyholm commented 8 years ago
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

sagikazarmark commented 8 years ago

LGTM, added a few comments.

dbu commented 8 years ago

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 commented 8 years ago

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