-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi.http
More file actions
58 lines (36 loc) · 1.37 KB
/
Copy pathapi.http
File metadata and controls
58 lines (36 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@baseUrl = http://localhost:3000
GET {{baseUrl}}/equipment
###
GET {{baseUrl}}/gyms/2/equipment
###
GET {{baseUrl}}/equipment/matrix-aura-diverging-seated-row/gyms
###
GET {{baseUrl}}/gyms/stats
// curl http://localhost:3000/gyms/stats | jq
###
http://localhost:3000/gyms/stats
// curl for adding a gym to favourites
404abe@Abrahams-MacBook-Pro gym-data-engine % curl -X POST http://localhost:3000/gyms/12/favourite \
-H "Content-Type: application/json" \
-d '{
"user_id": 1
}'
// curl for rating a equipment.
404abe@Abrahams-MacBook-Pro gym-data-engine % curl -X POST http://localhost:3000/equipment/2/rate \
-H "Content-Type: application/json" \
-d '{"user_id":1,"rating":5}'
// curlt o rate gym
404abe@Abrahams-MacBook-Pro gym-data-engine % curl -X POST http://localhost:3000/gyms/1/rate \
-H "Content-Type: application/json" \
-d '{"user_id":1,"rating":5}'
###
GET http://localhost:3000/gyms/1
###
GET http://localhost:3000/gyms/1/equipment
### Rate equipment
POST http://localhost:3000/equipment/1/rate
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiZW1haWwiOiJhYnJhaGFtLmFtYTIwMDNAZ21haWwuY29tIiwiaWF0IjoxNzc4OTMwMjg5LCJleHAiOjE3Nzk1MzUwODl9.MB0-GpArGdjBBVDylTAZ78NrM2beubSuhtOOxZd6UP4
{
"rating": 4
}