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
Custom User-Agent not remembered during session #180
Comments
I would love this feature. 👍 |
HTTPie supports sessions that allow you to do this. Example: Create a session file: $ http --session=/tmp/foo.json example.org blah:X Yada:Z
# or, you can also create the file manually:
$ echo '
{
"headers": {
"Yada": "Z",
"blah": "X"
}
}' > /tmp/foo.json
Reuse it whenever needed: $ http -v --session=/tmp/foo.json example.org
GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, compress
Host: example.org
User-Agent: HTTPie/0.8.0-dev
Yada: Z
blah: X Please see https://github.com/jkbr/httpie#sessions for more details. |
I guess we can reopen the issue because it is not what we were expecting. Let's say we create the JSON file:
Following your instructions, I do
which is leading to:
The first anomaly is
So not working. |
This will solve the rewriting
The |
When testing it is often useful to have a set of predefined profiles such as different set of headers for different browsers. It helps with testing Web sites.
One way to do that currently is to create a variable for each profile.
but it would be entirely possible to have a feature such as
where
foo
is a JSON file in.httpie/profiles/foo.json
The text was updated successfully, but these errors were encountered: