It just wraps curl and adds some nicer options, cookie handling, oauth and colorizing to it. Same command line you are already used to but with some extras that simplify live and make it more enjoyable.
See: https://github.com/jkbr/httpie#interface-design , https://github.com/jkbr/httpie#redirected-input , https://github.com/jkbr/httpie#usage
That is actually wrong. The -I flag set the request method to HEAD. So in some cases it will return different headers than a normal get request (and some servers don't implement HEAD responses at all).
alias h='curl -sIX GET -w "Total time: %{time_total} s\n"'
It issues a GET request, only prints the response headers and displays the time it took.> The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response.
and that
> The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request.
curl -o/dev/null -D- http://www.example.com
-I does not work with methods other than GET. This does the job.-i, --include (HTTP) Include the HTTP-header in the output. The HTTP-header includes things like server-name, date of the document, HTTP-version and more...
-I, --head (HTTP/FTP/FILE) Fetch the HTTP-header only! HTTP-servers feature the command HEAD which this uses to get nothing but the header of a document. When used on an FTP or FILE file, curl displays the file size and last modification time only.
I wasn't able to change the Host header successfully, though. A workaround is needed: https://groups.google.com/forum/?fromgroups=#!topic/httpfidd...
Just install gow ( https://github.com/bmatzelle/gow ) and you'll be able to run all of those examples as intended. The command line becomes very pleasant on Windows after that one little install. It's very lightweight and well designed.
BTW, here are some more cURL tips I noted down a while back, which I found to be useful for daily work. - http://laktek.com/2012/03/12/curl-tips-for-daily-use/
I'm pretty frustrated with sites that don't just have a basic two column layout. Is this a template theme? Otherwise why would you waste so much time on a left column that reflows and messes up the browser experience? Or better yet why not test this on an actual mobile browser?
I am not trying to harp on this site or the author specifically because there are certainly other offenders. This site though is quite annoying because once you finally think yougot that stupid menu out of the way, BOOM it pops right back an ruins the site again.
This is both a rant and a notice to the author since most people probably got too fed up to tell him about this problem.
They suggest you drop the number and go with something like "Uses for cURL everyone should know" instead.
> With cURL just point the request at your host’s IP address
It's not even necessary to manually look up the IP, since options have precedence:
curl server1.example.com -H Host:\ www.example.net
looks up server1.example.com and connects to that IP with the given Host: Header. Just try the "-v" option to see what's going on.I ran into an issue where the SSL implementation was a bit dated, though, and didn't recognize how a GoDaddy cert implemented multiple hostnames -- but it turned out to follow the standard. wget was just lacking in its implementation and reporting an error when the cert was fine.
Chrome: "Postman" extension
Firefox: "REST Client" addon
...both great utilities for creating and saving any HTTP request you need.
Your echo service is pretty nifty too.
exec 5<>"/dev/tcp/localhost/80"
echo -ne "GET / HTTP/1.1\r\nHost: localhost\r\n\r\n" > &5
cat < &5
FTFYThanks for making this!
btw: nice overview!
Really like the casual plug of your new project; I signed up :-)
Seriously how often are you guys performing PUTs and DELETEs manually from the command line? `man` up and write a wrapper.
For anyone not already familiar with this I'd recommend having a look at heirloom mailx[2].
Note, you can of course also pipe stuff to "/usr/bin/sendmail -t", which I'm sure was the thing claudio was alluding to.
[0] See eg: http://www.freebsdwiki.net/index.php/SMTP,_testing_via_Telne... vs: http://www.pcvr.nl/tcpip/smtp_sim.htm
Could you be more specific? I find it useful to understand different points of view.
Thanks
My guess is that caludio believes that good hackers would not find this article interesting. I somewhat agree, as I feel that article adds little to what can already be found in the cURL man page. Having said that, I do think there is worth in having good examples, which this article certainly did.
It's a little disheartening to see this at the top of HN though.