Skip to content

Instantly share code, notes, and snippets.

@mtkd
Last active October 10, 2015 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtkd/3729321 to your computer and use it in GitHub Desktop.
Save mtkd/3729321 to your computer and use it in GitHub Desktop.
Curl options
# return only HTTP status code
curl -sL -w "%{http_code}\\n" "http://news.ycombinator.com/" -o /dev/null
# return only HTTP status code and 302 URL
curl -sL -w "%{http_code} %{url_effective}\\n" "http://news.ycombinator.com/" -o /dev/null
# header only
curl -I news.ycombinator.com
# basic auth
curl -u username:password "http://news.ycombinator.com" -o /dev/null
# IIS auth
curl -u username:password "http://news.ycombinator.com" -o /dev/null --ntlm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment