test.sh 777 B

1234567891011121314151617
  1. #!/bin/bash
  2. curl -X POST -d '{"name":"Player 1","score":0}' -H "Content-Type: application/json" http://127.0.0.1:8080/players
  3. curl -X POST -d '{"name":"Player 2","score":0}' -H "Content-Type: application/json" http://127.0.0.1:8080/players
  4. curl -X POST -d '{"name":"Player 3","score":0}' -H "Content-Type: application/json" http://127.0.0.1:8080/players
  5. curl -X POST -d '{"name":"Player 4","score":0}' -H "Content-Type: application/json" http://127.0.0.1:8080/players
  6. curl -X PATCH -d '{"score":42}' -H "Content-Type: application/json" "http://127.0.0.1:8080/players/Player%201"
  7. curl -X GET "http://127.0.0.1:8080/players/Player%201"
  8. curl -X GET "http://127.0.0.1:8080/players/Player%202"
  9. curl -X DELETE -H "Content-Type: application/json" http://127.0.0.1:8080/players