Skip to content

Instantly share code, notes, and snippets.

@stefan-vatov
Created September 28, 2021 11:53
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 stefan-vatov/4333e725567a4a3decb4ca8bca236eda to your computer and use it in GitHub Desktop.
Save stefan-vatov/4333e725567a4a3decb4ca8bca236eda to your computer and use it in GitHub Desktop.
[capture curl http code and result]
STATUSCODE=$(curl --silent --output result.txt --write-out "%{http_code}" --request GET URL)
cat result.txt
if test $STATUSCODE -ne 200; then
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment