generated from MLH-Fellowship/sre-portfolio-site
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
curl-test.sh
executable file
·17 lines (16 loc) · 1.06 KB
/
curl-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
echo "GET TimelinePost"
curl --silent -X GET http://localhost:5000/api/timeline_post | jq .
echo "POST TimelinePost"
curl --silent -X POST http://localhost:5000/api/timeline_post -d "name=Alex&[email protected]&content=Never" | jq .
curl --silent -X POST http://localhost:5000/api/timeline_post -d "name=Juan&[email protected]&content=gonna" | jq .
curl --silent -X POST http://localhost:5000/api/timeline_post -d "name=Gino&[email protected]&content=give" | jq .
curl --silent -X POST http://localhost:5000/api/timeline_post -d "name=Yundi&[email protected]&content=you" | jq .
curl --silent -X POST http://localhost:5000/api/timeline_post -d "name=Emilie&[email protected]&content=up" | jq .
echo "GET TimelinePost"
POSTS=$(curl --silent -X GET http://localhost:5000/api/timeline_post)
echo $POSTS | jq .
echo "DELETE TimelinePost"
echo $POSTS | jq -s ".[].timeline_posts[].id" | xargs -I %id% curl --silent -X DELETE http://localhost:5000/api/timeline_post -d "id=%id%" | jq .
unset POSTS
echo "GET TimelinePost"
curl --silent -X GET http://localhost:5000/api/timeline_post | jq .