Friday, June 7, 2013

how to let cURL display the HTTP response code

How To Display Just The HTTP Response Code In Command Line Curl

Adding this to a curl command line is actually quite useful:
--write-out "%{http_code} %{url_effective}\\n"
Now I actually wonder why curl doesn't display the HTTP response code by default. In my scraping scripts (based on libcurl) I have always been making use of it anyway. But every now and then you have another requirement for your favourite tool.

No comments: