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
Have an option to encode fields in URL (http://foo.com/q?x=1&y=2) #61
Comments
Try this: |
I know I can hand craft the URL. However I prefer httpie to do that for me, and url-encode the parameters as well. |
The items (link |
On one hand, it would be good to keep the data parameter semantics consistent across all HTTP method (i.e., they are used to construct the request body no matter what the method is). There isn't almost any method-specific logic in httpie, which makes it possible to issue the same request via different HTTP methods simply by changing the method name argument. On the other hand, although it's valid, it's rather unusual for I'm not sure, though, if the pros (the ability to conveniently craft URL parameters) actually outweigh the cons (at the expense of breaking consistency). |
You can make it explicit with a command line switch if you prefer to avoid "magic" (--args-in-url? I don't not, I stink at naming things :). |
I have run into this issue as well, and I think that @tebeka has a good compromise solution. I would be willing to hack this out, but I wanted to get a feel for if the change is wanted or not. Thoughts? |
Another option would be to introduce a new separator for the querystring parameters. Perhaps something like It has the advantage that it's usable with any HTTP method and the existing interface remains unchanged. On the other hand, it's not as clean and intuitive as plain |
I think |
The best thing about this feature for me would be the ability to write options when I think of them, without going back to insert them. |
@benatkin That looks better than having a flag changing the meaning of I've merged @jakebasile's pull request (thanks!). Let's see how this feels, it can be changed before 0.2.6 final if it proves to be confusing or difficult to use. |
The format in |
Great, thanks! |
Glad it made it (in slightly altered form) into the release! 🍰 |
Some services (like google maps api) require a GET with arguments encoded in the URL.
Add an option to do that (and probably default to it in GET method?)
The text was updated successfully, but these errors were encountered: