Uses for cURL
11–20 of 75 posts
Re: Uses for cURL
#12Re: Uses for cURL
#13I would strongly suggest HTTPie for the majority of these tasks: https://github.com/jkbr/httpie
May I ask why? What benefits does HTTPie have?
See: https://github.com/jkbr/httpie#interface-design , https://github.com/jkbr/httpie#redirected-input , https://github.com/jkbr/httpie#usage
Re: Uses for cURL
#14> If you only care about headers use the -I flag and the response body will be hidden 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).
Ah, great catch. Added a note about having to specify the method explicitly / that -I uses HEAD implicitly. Thanks!
curl -o/dev/null -D- http://www.example.com
-I does not work with methods other than GET. This does the job.Re: Uses for cURL
#15I 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.
Re: Uses for cURL
#16Really like the casual plug of your new project; I signed up :-)
Re: Uses for cURL
#17I wasn't able to change the Host header successfully, though. A workaround is needed: https://groups.google.com/forum/?fromgroups=#!topic/httpfidd...
Re: Uses for cURL
#18Earlier quoted context omitted.
Ah, great catch. Added a note about having to specify the method explicitly / that -I uses HEAD implicitly. Thanks!
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.
Re: Uses for cURL
#19I would strongly suggest HTTPie for the majority of these tasks: https://github.com/jkbr/httpie
Re: Uses for cURL
#20I would strongly suggest HTTPie for the majority of these tasks: https://github.com/jkbr/httpie
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.