Guest User

Untitled

a guest
Jun 23rd, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ORIGIN=$1
  4. URI=$2
  5. METHOD=$3
  6.  
  7. if [ -z "$3" ] && [ -z "$METHOD" ]; then
  8. echo -e "You did not provide a method! The default is GET.\nYou can provide a third param to specify the method.\n"
  9. METHOD="GET"
  10. fi
  11.  
  12. if [ -n "$ORIGIN" ] && [ -n "$URI" ]; then
  13. curl -X $METHOD -H "Origin: ${ORIGIN}" --verbose "${URI}"
  14. else
  15. 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."
  16. fi
Add Comment
Please, Sign In to add comment