Replies: 1 comment
-
|
@danudey - This seems valuable to me yep. Thanks for the suggestion. My inclination here would be supporting a (If we want to add |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
httpx is a pretty great tool, but one thing I've noticed is that it's (apparently) impossible to use the CLI's download mode to get a progress bar but not show the HTTP response information. An example for when this would be useful is to use in a shell script.
Currently the 'best' way to do this that I know of is to use wget:
wget --quiet --show-progress --progress=barThis works fine, but in cases where I have
httpx(with CLI) installed already (or I'm already installing Python packages into the environment), thehttpxprogress bar is much nicer.I can also envision cases where I want to fetch and display (or pipe) the contents of a file to stdout, but again without the extra headers.
What I propose is a CLI flag,
--show-headers/--hide-headers, in which:--show-headersis the default behavior--hide-headersprevents the output of response headers in all cases (standard or download mode)---show-headersafter--hide-headersresets the headers display; this is common behavior in other CLI utilities, and is default behavior provided byclick.I have added this functionality in my own fork and added unit tests for the functionality, for both standard and download mode. You can see the commit here:
danudey@f1069d9
I haven't created a PR for this, as the 'Contributing' doc implies that a discussion should happen first, but I'm happy to create the PR if people feel this functionality could be useful.
Beta Was this translation helpful? Give feedback.
All reactions