-
Notifications
You must be signed in to change notification settings - Fork 35
/
samples.http
57 lines (44 loc) · 1.14 KB
/
samples.http
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
@port = {{$dotenv PORT}}
@baseUrl = http://localhost:{{port}}/api
### Get markers
# @name getMarkers
GET {{baseUrl}}/markers HTTP/1.1
Accept: application/json
### Insert a marker
# @name insertMarker
POST {{baseUrl}}/markers HTTP/1.1
Content-Type: application/json
{
"type": "fish_hotspot3",
"position": [9455.411, 8984.482]
}
### Get comments
# @name getComments
@markerId = {{getMarkers.response.body.$[0]._id}}
GET {{baseUrl}}/markers/{{markerId}}/comments HTTP/1.1
Accept: application/json
### Insert a comment
# @name insertComment
@markerId = {{getMarkers.response.body.$[0]._id}}
POST {{baseUrl}}/markers/{{markerId}}/comments HTTP/1.1
Content-Type: application/json
{
"username": "[Coach] Leon",
"message": "This is a test comment"
}
### Register/Login a user
POST {{baseUrl}}/users HTTP/1.1
Content-Type: application/json
{
"username": "lmachens"
}
### Get a user
GET {{baseUrl}}/users/lmachens HTTP/1.1
Accept: application/json
### Update hidden marker ids
@markerId = {{getMarkers.response.body.$[0]._id}}
PATCH {{baseUrl}}/users/lmachens HTTP/1.1
Content-Type: application/json
{
"hiddenMarkerIds": ["{{markerId}}"]
}