-
Notifications
You must be signed in to change notification settings - Fork 103
.netrc support for arbitrary headers #414
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
Comments
Would sessions work? .netrc is a weird piece of legacy compatibility that I'd rather not extend unless there's some existing standard for it. |
Eh, sessions are httpie-specific, while I reuse netrc between many tools. But if it doesn't seem right, feel free to close the ticket. :) |
Do the other tools support headers in netrc files? In that case it might make sense to bring xh in line. |
ehh couldn't find a tool that does anything like that. I was drawn to |
Maybe we could introduce $ cat ~/.netrc
machine httpbin.org password x-api-key:12345
$ xh --offline -A header httpbin.org/get
GET /get HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, br, zstd
X-Api-Key: 12345 # <------- header read from .netrc
Connection: keep-alive
Host: httpbin.org
User-Agent: xh/0.23.1 With that being said, this might be stretching |
I frequently encounter apis that want something like
X-Token: <token>
orAuthorization: <token>
(with no prefix) - would be nice to be able to tellxh
to take password as token from.netrc
. Not sure how would that look like syntactically. :)The text was updated successfully, but these errors were encountered: