Created
February 12, 2019 00:36
-
-
Save mttjohnson/949565ee5152861b7f740b6882297798 to your computer and use it in GitHub Desktop.
Curl Testing Web Servers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Curl manual: https://curl.haxx.se/docs/manpage.html | |
| URL="https://www.example.org/" | |
| HTTP_AUTH="-u name:passwd" | |
| CURL_OPT="--trace -" | |
| CURL_OUT="-o /dev/null" | |
| curl -s ${HTTP_AUTH} ${CURL_OPT} ${CURL_OUT} -w "%{http_code} - ${URL}\n" "${URL}" | |
| URL="https://www.example.org/"; HTTP_AUTH=""; CURL_OPT=""; CURL_OUT="-o /dev/null"; \ | |
| curl -s ${HTTP_AUTH} ${CURL_OPT} ${CURL_OUT} -w "%{http_code} - ${URL}\n" "${URL}" | |
| # Override DNS and specify a different IP to connect to | |
| URL="https://www.example.org/" | |
| CURL_OPT="--resolve www.example.org:443:127.0.0.1" | |
| CURL_OUT="-o /dev/null" | |
| HTTP_AUTH="" | |
| curl -s ${HTTP_AUTH} ${CURL_OPT} ${CURL_OUT} -w "%{http_code} - ${URL}\n" "${URL}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment