X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fcurl.txt;h=6f2d0ac1eff5fe8b5931e21c3c305bc3df0cc917;hb=787fc3b74e498cb78f516e372827790ba78920ac;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=eb0f8a4b6570192248292f1841f71ce2df39457f;p=Project_proches_de_moi-server.git diff --git a/tests/curl.txt b/tests/curl.txt index e69de29..6f2d0ac 100644 --- a/tests/curl.txt +++ b/tests/curl.txt @@ -0,0 +1,27 @@ +* Create a user: +curl --request POST http://localhost:8000/api/person/register --data "{ \"firstname\": \"James\", \"lastname\": \"Elbow\", \"email\": \"james@elbow.com\", \"password\": \"FD3CC7719AB1776B81D70B65170D8A51119E127488C106622E0D2E680C1B3FFF\" }" --header "Content-Type: application/json" + +* Delete a user with id 1: +curl --request DELETE http://localhost:8000/api/person/1 + +* Update a user with id 1: +curl --request PUT http://localhost:8000/api/person/1 --data "{ \"firstname\": \"Jamesson\", \"lastname\": \"Elbow\", \"email\": \"james@elbow.com\" }" --header "Content-Type: application/json" + +* Update/add a user with id 1 localisation: +curl --request POST http://localhost:8000/api/person/1/localisation --data "{ \"timestamp\": \"$(date --iso-8601=seconds)\", \"latitude\": \"43.23\", \"longitude\": \"5.43\" }" --header "Content-Type: application/json" + +* Update a user online status: +curl --request PUT http://localhost:8000/api/person/1/online +curl --request PUT http://localhost:8000/api/person/1/offline + +* Show a user with id 1: +curl --request GET http://localhost:8000/api/person/1 + +* Show a user with id 1 friends: +curl --request GET http://localhost:8000/api/person/1/friends + +* Show a user with id 1 localisation: +curl --request GET http://localhost:8000/api/person/1/localisation + +* Show a user with id 1 localisations: +curl --request GET http://localhost:8000/api/person/1/localisations