3 ms·
There is more to it than that. It provides an expressive syntax to construct all sorts of requests. You can submit forms, upload files and set headers without h
by jkbr 14y ago
There is more to it than that. It provides an expressive syntax to construct all sorts of requests. You can submit forms, upload files and set headers without having to use flags. You also get syntax highlighting, ability to pipe in request data, etc.
If you are sending complex JSON, it's probably stored in a file or it's the output of another program:
http PUT httpbin.org/put @/data/test.json
http -b localhost:8888/couchdb/ | http PUT httpbin.org/put
- Camillo 14y agoWhy not use JSON syntax for JSON instead of introducing your own, though?
- jkbr 14y agoYou can still use regular JSON syntax, if you like: echo '{"foo": "bar"}' | http url The reason for having the simplified one is that it's less verbose and usually doesn't even require you to quote it: http url foo=bar
- javajosh 14y agoYeah, most of us would forget to single quote the JSON. It is definitely more verbose too - I agree with the command-line compatible simplification.
- zeroonetwothree 14y agoI don't really think curl is much harder, e.g. curl -X PUT -d @data/test.json httpbin.org/put It also has the advantage that it supports all the options you might ever need, for example http authentication and proxies are often useful.
- jkbr 14y agoHTTPie also supports proxies and HTTP auth (see --proxy and -a/--auth).
- shazow 14y agoDoesn't support socks 4/5 proxies. :) Requests and urllib3 have a long way to go to be complete competitors with cURL. P.S. Good job nonetheless. Seems like a good idea to make a specialized HTTP CLI client for JSON/RESTful services.
- tripzilch 14y agoIt has the disadvantage that it's not at all obvious what it does unless I open up the man page.