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

Consider printing headers as json #119

Open
bibliotechy opened this issue Jun 23, 2021 · 2 comments
Open

Consider printing headers as json #119

bibliotechy opened this issue Jun 23, 2021 · 2 comments

Comments

@bibliotechy
Copy link
Contributor

When the -i flag to include headers in response is provided, a python dict representation (actually the requests custom case-indifferent dict) of the headers are printed. Looks deceptively like JSON at a quick glance.

If the headers were dumped as valid JSON, tools like jq could be used for digging into them, which aids in readability and using that header data as part of a pipeline.

@okigan
Copy link
Owner

okigan commented Jun 23, 2021

should we revamp it to behave like: https://everything.curl.dev/usingcurl/verbose/writeout

@bibliotechy
Copy link
Contributor Author

That functionality definitely seems useful, but I don't actually see support for writing out arbitrary headers with any of those variables.

Thinking about curl as the baseline, curl's -i flag prints the headers one per line which at least can be parsed with grep or similar.

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

No branches or pull requests

2 participants