Closed TomasNilsson closed 9 years ago
Comment by tomas-nilsson Monday Mar 02, 2015 at 04:24 GMT
How to add a friend:
curl -v -H "Accept: application/json" -H "Content-type: application/json" -H 'Authorization: Token token="dsajhgsljkhvdsahlskfhbcöj"' -X POST -d ' {"id":"1"}' http://localhost:3000/api/friendships
id is the user id of the user you want to add as a friend.
How to remove a friend:
curl -v -H "Accept: application/json" -H "Content-type: application/json" -H 'Authorization: Token token="dsajhgsljkhvdsahlskfhbcöj"' -X POST -d ' {"id":"1"}' http://localhost:3000/api/friendships/remove
id is the user id of the user you want to remove as a friend.
How to get a list of current friends:
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -H 'Authorization: Token token="dsajhgsljkhvdsahlskfhbcöj"' -X GET http://localhost:3000/api/friendships
The list will look like the JSON output in #4.
Issue by tomas-nilsson Sunday Feb 15, 2015 at 05:42 GMT Originally opened as https://github.ucsb.edu/tomas-nilsson/SpotiTraceApp/issues/11