Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ORIGIN=$1
- URI=$2
- METHOD=$3
- if [ -z "$3" ] && [ -z "$METHOD" ]; then
- echo -e "You did not provide a method! The default is GET.\nYou can provide a third param to specify the method.\n"
- METHOD="GET"
- fi
- if [ -n "$ORIGIN" ] && [ -n "$URI" ]; then
- curl -X $METHOD -H "Origin: ${ORIGIN}" --verbose "${URI}"
- else
- echo -e "You need to provide at least two parameters. \nFirst; The origin domain to mock a call from this domain.\nSecondly, the url to hit with this cURL call to test this out."
- fi
Add Comment
Please, Sign In to add comment