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

Output request/response headers to stderr #41

dylanowen opened this issue Feb 13, 2020 · 1 comment

Output request/response headers to stderr #41

dylanowen opened this issue Feb 13, 2020 · 1 comment


Copy link

@dylanowen dylanowen commented Feb 13, 2020

I've been using dot-http for some scripting tasks, it'd be nice to have the response body be the only thing output over stdout, much like curl.


This comment has been minimized.

Copy link

@bayne bayne commented Feb 15, 2020

I wanted to reserve stderr for other purposes (eventually wanting to print out metrics such as request time etc)

My end-goal was to have a --response-output-format="FORMAT_STRING_HERE" where the format string could be constructed to suppress the headers. As a convenience, I'm imagining creating flags that are synonymous to an expanded form of --response-output-format="FORMAT_STRING_HERE"

For example, if we had a response like


HTTP/1.1 200 OK
date: Sat, 15 Feb 2020 19:29:22 GMT

  "origin": "",
  "url": ""

The response format string would be %R\n%S\n%H\n%B where

  • %R is POST
  • %S is HTTP/1.1 200 OK
  • %H are the headers
  • %B is the body

So to solve your problem, I would want the solution to be:


which is synonymous with


For the time being (since none of the response format exists yet), a mergeable change would be to:

  1. Create a new flag --only-output-body
  2. Update the response handler to prevent printing other parts of the response when that flag is set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.