-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Labels
needs product designWe like the idea, but we want to explore the problem deeper, and consider the solution holisticallyWe like the idea, but we want to explore the problem deeper, and consider the solution holistically
Description
This seems to be related to #215 and #180, but is not a pure duplicate:
I would like to be able to create an alias or shell function for accessing a certain rest API requiring authentication. I started with
function girder {
https --session=~/.girder_session.json girder.host.local.lan/api/v1/$1 ${@:2}
}
but my main problem is that I cannot change the HTTP method (e.g. to PUT or PATCH) this way. I would like to be able to have a different way of specifying the default host, so that I do not have to add a commandline parsing around httpie. And I do have some hope, since httpie already supports a default hostname, only that it's hardcoded to be localhost.
I see two potential solutions:
- Allow setting of default base_url #215 contains a small change introducing an environment variable for the default host, which would solve my issue.
- Another idea I had (more in the line of Custom User-Agent not remembered during session #180) would be to make the default hostname an optional part of the sessions. Maybe that could even be made to work with named sessions, by looking into a "default" host directory:
~/.httpie/sessions/default/<name>.json
With both solutions, the above shell function could be turned into a simple alias passing the desired --session parameter.
lachtanek, vy-let, chrislloyd, vergenzt, nezda and 3 more
Metadata
Metadata
Assignees
Labels
needs product designWe like the idea, but we want to explore the problem deeper, and consider the solution holisticallyWe like the idea, but we want to explore the problem deeper, and consider the solution holistically