-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.http
More file actions
78 lines (58 loc) · 1.53 KB
/
api.http
File metadata and controls
78 lines (58 loc) · 1.53 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
### Run ping
GET http://127.0.0.1:9556/api/healthcheck
> {%
client.test("Response has body", () => {
client.assert(response.status === 200)
client.assert(response.body.status === "OK")
})
%}
### Login
POST http://127.0.0.1:9556/login
Content-Type: application/json
{
"email": "komok@heapy.io",
"password": "!}{6-Q65Ex]TxS$:&?jpx0.?X-Y#+1k^@[Tw/3X;Mb7^i$3>c%m[~NSg^8}7sx5F?zAcb3G$>L;qJ5c_7mp:L^hO][}fR9vPp,ATj)=wb}pFPumm0Utvs#!Odls+8tT85I;CetOAuq^zY,gxffHU{p/7ndJH:bMb0Hh",
"otp": "148899"
}
> {% client.global.set("komok_cookie", response.headers.valueOf("Set-Cookie")); %}
### Get me
GET http://127.0.0.1:9556/me
Cookie: {{komok_cookie}}
### Get index.html
GET http://127.0.0.1:9556
### Head index.html
HEAD http://127.0.0.1:9556
### Insert new entity
POST http://127.0.0.1:9556/api/entity
Content-Type: application/json
{
"title": "New entity",
"text": "New entity text",
"date": "2021-01-01",
"readStatus": false
}
### Get latest entities
GET http://127.0.0.1:9556/api/entity
### Update new entity
PUT http://127.0.0.1:9556/api/entity
Content-Type: application/json
{
"id": 2
}
### Insert new entity
POST http://127.0.0.1:9556/api/mongo/entity
Content-Type: application/json
{
"title": "New entity",
"text": "New entity text",
"date": "2021-01-01",
"readStatus": false
}
### Get latest entities
GET http://127.0.0.1:9556/api/mongo/entity
### Update new entity
PUT http://127.0.0.1:9556/api/mongo/entity
Content-Type: application/json
{
"id": "66a34c9bb2c34e1fab6e6077"
}