okigan / awscurl

curl-like access to AWS resources with AWS Signature Version 4 request signing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider printing headers as json

bibliotechy opened this issue · comments

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.

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.