Skip to content

Instantly share code, notes, and snippets.

@christopher-hopper
Last active November 13, 2019 23:24
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 christopher-hopper/4a9694ba1c1f4692cacd849a9bd1cae1 to your computer and use it in GitHub Desktop.
Save christopher-hopper/4a9694ba1c1f4692cacd849a9bd1cae1 to your computer and use it in GitHub Desktop.
RESTful API testing response headers using wget or curl
# RESTful API 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