Live data from Hacker News

Uses for cURL

httpkit.com

71–75 of 75 posts

Re: Uses for cURL

#71
post #50
post #17

If you're on windows and don't feel like using the commandline you can click around in Fiddler to achieve similar things. The help is much shorter http://www.fiddler2.com/fiddler/help/composer.asp I wasn't able to change the Host header successfully, though. A workaround is needed: https://groups.google.com/forum/?fromgroups=#!topic/httpfidd...

> If you're on windows and don't feel like using the commandline 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.

Does gow support curses yet? Last I used it, it broke my zsh completion.

(I just use Cygwin now, though, because mintty beats CSRSS all hollow.)

Re: Uses for cURL

#72
post #50
post #17

If you're on windows and don't feel like using the commandline you can click around in Fiddler to achieve similar things. The help is much shorter http://www.fiddler2.com/fiddler/help/composer.asp I wasn't able to change the Host header successfully, though. A workaround is needed: https://groups.google.com/forum/?fromgroups=#!topic/httpfidd...

> If you're on windows and don't feel like using the commandline 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.

How does that compare to mingw32/MSYS?

http://mingw.org/

Re: Uses for cURL

#73
post #36

I knew 8 of the 9, but the one I didn't (testing virtual hosts) was worth the cost of reading the entire article. Thanks.

That will only work with named vhosts. Outside of shared hosting / personal web servers, almost everyone uses IP-defined vhosts.

Well, doesn't everyone do "their own" shared hosting? With ip4 getting more and more scarce, and before ip6 is viable, I'll definitely keep using named vhosts for stuff. Add in SNI, and it even works with SSL. Sort of.

Re: Uses for cURL

#74
post #22

I hope tomorrow I'll see an even more useful article on sending email from the command line! Wow. /sarcasm

You know, sending email from the command line isn't quite trivial, if you want to send in anything other than ascii. Telnet[0] to port 25 can be a lot of fun (alternatively openssl s_client[1] -starttls smtp ...).

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

[1] http://www.madboa.com/geek/openssl/#cs-smtp

[2] http://heirloom.sourceforge.net/mailx.html

Re: Uses for cURL

#75
post #14

Earlier quoted context omitted.

A better way to view only the header of a response is using the flags -o to redirect the body and -D to redirect the header of the response. When I want to print only the header to stdout I do curl -o/dev/null -D- http://www.example.com -I does not work with methods other than GET. This does the job.

Why not just use -i?

-i mixes the header and the body of the response into one stream. If you want only the header it won't help.
Post reply on HN