Created
May 9, 2017 18:52
-
-
Save michabbb/aa8888a6311d02abfd3370fe87b12cae to your computer and use it in GitHub Desktop.
Test Mailgun API Http Response Header
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
KEY=$1 | |
EMAIL=$2 | |
MD5=`echo -n "$KEY $EMAIL" | md5sum| awk '{print $1}'` | |
curl -o /dev/null -s -sw "%{http_code}" -G --user "api:$KEY" -G https://api.mailgun.net/v3/address/validate --data-urlencode address="$EMAIL" > /tmp/$MD5 | |
RESPONSE_CODE=`cat /tmp/$MD5` | |
if [ $RESPONSE_CODE -eq 200 ]; then | |
echo "OK: $RESPONSE_CODE" | |
exit 0 | |
else | |
echo "FAILED: $RESPONSE_CODE" | |
exit 2 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment