Last active
July 9, 2024 01:03
-
-
Save christopher-hopper/4a9694ba1c1f4692cacd849a9bd1cae1 to your computer and use it in GitHub Desktop.
Testing HTTP response headers using wget or curl
This file contains 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
# HTTP response header testing. | |
# wget | |
# - method: GET | |
# - output: response headers only | |
wget --server-response --quiet \ | |
--output-document=/dev/null --output-file=- \ | |
https://example.com/api/endpoint | |
# curl | |
# - method: GET | |
# - output: response headers only | |
curl --insecure --head --location --silent \ | |
https://example.com/api/endpoint | |
# curl | |
# - short non-posix options | |
# - output: response headers only | |
# | |
# -k insecure, ignore cert problems | |
# -I headers only | |
# -L follow location redirects | |
# -s silent, no progress | |
curl -kILs https://example.com/api/endpoint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add a user-agent string to bypass some WAF (Web Application Firewall) checks that only allow requests from a real browser.