Curl -isS good

| | [C]olor

I like curl's -Sf options which make curl fail fast, and print its error code. Suppose I send a request to an non-existing endpoint of my app, then the app will return a 404.html:

$ curl -isX POST localhost:3000

# prints headers and 404.html

Usually responses of failed requests are not of interest, so lets pass -Sf to fail fast:

$ curl -isSfX POST localhost:3000
curl: (22) The requested URL returned error: 404 Not Found

Much better. I keep these options in ~/.curlrc which is sourced by every curl command. To ignore the contents of ~/.curlrc use the -q option.