X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fcurl.txt;h=7e147312b7fe458a7968f2ae43dd22790dbae3f5;hb=80ec112fadb2fb94341049775f12fd5496662129;hp=8202612adde585ce0d596dffd3a0a7f7c39ff6fc;hpb=f0640a5242b2a959068696eed3d41c37d07633a7;p=Project_proches_de_moi-server.git diff --git a/tests/curl.txt b/tests/curl.txt index 8202612..7e14731 100644 --- a/tests/curl.txt +++ b/tests/curl.txt @@ -1,14 +1,42 @@ -* Create a user : -curl --request POST --data "{ \"firstname\": \"James\", \"lastname\": \"Elbow\", \"email\": \"james@elbow.com\", \"password\": \"FD3CC7719AB1776B81D70B65170D8A51119E127488C106622E0D2E680C1B3FFF\"}" http://localhost:8000/api/person/register --header "Content-Type: application/json" +* 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\": \"jamesson@elbow.com\" }" --header "Content-Type: application/json" + +* Authenticate a user with email and password: +curl --request POST http://localhost:8000/api/person/authenticate --data "{ \"email\": \"jamesson@elbow.com\", \"password\": \"FD3CC7719AB1776B81D70B65170D8A51119E127488C106622E0D2E680C1B3FFF\"}" --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 + +* Search a user with a keyword: +curl --request POST http://localhost:8000/api/person/search --data "{ \"keyword\": \"isabelle\"}" --header "Content-Type: application/json" * Show a user with id 1: curl --request GET http://localhost:8000/api/person/1 -* Show a user with id 1 friends : +* Show a user with id 1 friends: curl --request GET http://localhost:8000/api/person/1/friends -* Show a user with id 1 localisation : +* Show a user with id 1 friends with me: +curl --request GET http://localhost:8000/api/person/1/friendswithme + +* Show a user with id 1 localisation: curl --request GET http://localhost:8000/api/person/1/localisation -* Show a user with id 1 localisations : +* Show a user with id 1 fuzzy localisation at a distance of 300 meters: +curl --request GET http://localhost:8000/api/person/1/localisation/fuzzy/300 + +* Show a user with id 1 localisations: curl --request GET http://localhost:8000/api/person/1/localisations + +* Show a user with id 1 fuzzy localisations at a distance of 300 meters: +curl --request GET http://localhost:8000/api/person/1/localisations/fuzzy/300