Setting Default request headers for API requests using xh
If you set up xh with a default session (adding {"default_options":["—session=auth"]} to your config.json), it will automatically send headers you set on subsequent requests to the same domain. This is really helpful for automatically authenticating requests without injecting an API key manually every time.
E.g.
xh https://httpbin.org/ API-Key:example-key
then subsequent requests don't need the key:
xh -v https://httpbin.org
This is really handy when I'm making use of an API a lot, meaning I don't have to keep including the key in my requests.