Skip to content

Commit

Permalink
shell script
Browse files Browse the repository at this point in the history
  • Loading branch information
va9id committed Oct 15, 2023
1 parent 1f539a3 commit 834c1a3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions curl_lab5.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

# Add Address book
curl -i -X POST -H "Content-Type:application/json" -d '{"buddies":[]}' http://localhost:8080/addressBooks

# Add Buddy
curl -i -X POST -H "Content-Type:application/json" -d '{"name":"mbappe", "phone":"7"}' http://localhost:8080/buddyInfoes
curl -i -X POST -H "Content-Type:application/json" -d '{"name":"messi", "phone":"10"}' http://localhost:8080/buddyInfoes

# Add 2 Buddy to Address Book
curl -i -X PATCH -H "Content-Type:text/uri-list" -d "http://localhost:8080/buddyInfoes/1" http://localhost:8080/addressBooks/1/buddies
curl -i -X PATCH -H "Content-Type:text/uri-list" -d "http://localhost:8080/buddyInfoes/2" http://localhost:8080/addressBooks/1/buddies

# Delete Address Book
curl -i -X DELETE http://localhost:8080/addressBooks/1

# Delete 2 Buddy
curl -i -X DELETE http://localhost:8080/buddyInfoes/1
curl -i -X DELETE http://localhost:8080/buddyInfoes/2

# Recall that gui is @ http://localhost:8080/display?id=1

0 comments on commit 834c1a3

Please sign in to comment.