Created
April 23, 2020 20:18
-
-
Save nipunthathsara/1b2e14fc49a1cb27e2ba6b5b72948403 to your computer and use it in GitHub Desktop.
Shell - Curl with random inputs
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
while(true) | |
do | |
curl -k -v -X POST 'http://192.168.43.173:5000/api/sensor-data' \ | |
--header 'Content-Type: application/json' \ | |
--header 'x-auth-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiaWF0IjoxNTg3NjUxMzEzLCJleHAiOjE1ODc2NTQ5MTN9.JLaDFORUBzIgH58c1BZLKFH6YiHkOEaCcXh015kZtfA' \ | |
--header 'Content-Type: Application/json' \ | |
--data "{\"sensorId\": \"$(( ( RANDOM % 10 ) + 1 ))\", \"co2Level\": \"$(( ( RANDOM % 10 ) + 1 ))\", \"smokeLevel\": \"$(( ( RANDOM % 10 ) + 1 ))\"}" | |
sleep 5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment