123456789101112131415161718192021222324252627282930 |
- #!/bin/bash
-
- # Prompt the user to enter the value of HOSTNAME
- read -p "Enter the HOSTNAME: " HOSTNAME
-
-
- # Log in to the app.
- curl "http://$HOSTNAME/identity/api/auth/login" \
- -H 'Content-Type: application/json' \
- --data-raw '{"email":"apilab@akamai.com","password":"cRaPi2023!!!"}' \
- --insecure -s \
- -o /dev/null
-
- # Loop through order IDs from 1 to 10
- for order_id in {1..10}; do
- # Make the API request for the current order ID without including auth header
- curl "http://$HOSTNAME/workshop/api/shop/orders/$order_id" \
- -H 'Accept: */*' \
- -H 'Accept-Language: en-US,en;q=0.9' \
- -H 'Connection: keep-alive' \
- -H 'Content-Type: application/json' \
- -H "Referer: http://$HOSTNAME/orders?order_id=$order_id" \
- -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36' \
- -H 'pragma: akamai-x-ro-trace' \
- -H 'x-akamai-a2-disable: on' \
- -H 'x-akamai-ro-piez: on' \
- -H 'x-im-piez: on' \
- --compressed \
- --insecure | jq -j
- done
|