-
Notifications
You must be signed in to change notification settings - Fork 96
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
Add --all flag for printing intermediate requests and responses #137
Conversation
|
Co-authored-by: Jan Verbeek <jan.verbeek@posteo.nl>
this is to avoid confusion with http redirect
That's what I think we should file an issue with HTTPie for clarification to fix either the implementation or the 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.
From experimenting and digging around HTTPie's source code I think its --history-print
is unused. Or maybe I'm missing something.
Printing the first request and last response by default seems reasonable to go with for now.
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.
Two tiny nitpicks, but I'm also ok with ignoring them.
client.on_redirect(|prev_response, next_request| { | ||
printer.print_response_headers(&prev_response)?; | ||
printer.print_response_body(prev_response)?; | ||
printer.print_seperator()?; |
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.
HTTPie doesn't have exactly this logic, http -v --print= --follow httpbin.org/status/302
has zero lines of output. (I haven't checked which logic it does use.)
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 will look into this in a separate PR as I have a feeling that the fix will be a little bit more involved.
Also adds the
history_print
flag for customizing printed sections for intermediate requests only.Ticks another item from #4.