This repository has been archived by the owner on May 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrequests.http
93 lines (74 loc) · 1.93 KB
/
requests.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
@host = http://localhost:3000
@userEmail = example@mail.com
@userPass = examplePass!
@userName = Example User
### Get api status
# @name apiStatus
GET {{host}}/status
Content-Type: application/json
### Register user
# @name userRegister
POST {{host}}/users
Content-Type: application/json
{
"email": "{{userEmail}}",
"password": "{{userPass}}",
"name": "{{userName}}"
}
### Log in user
# @name userLogin
POST {{host}}/users/login
Content-Type: application/json
{
"email": "{{userEmail}}",
"password": "{{userPass}}"
}
### Refresh auth tokens
# @name userRefresh
POST {{host}}/users/refresh
Content-Type: application/json
{
"refresh": "{{userLogin.response.body.refresh}}"
}
### Get user data
# @name userData
GET {{host}}/users/me
Content-Type: application/json
Authorization: Bearer {{userLogin.response.body.access}}
### Get user tasks
# @name userTasks
GET {{host}}/users/me/tasks
Content-Type: application/json
Authorization: Bearer {{userLogin.response.body.access}}
### Create task
# @name taskCreate
POST {{host}}/tasks
Content-Type: application/json
Authorization: Bearer {{userLogin.response.body.access}}
{
"title": "Examples task",
"done": false
}
### Get tasks
# @name taskGet
GET {{host}}/tasks
Content-Type: application/json
Authorization: Bearer {{userLogin.response.body.access}}
### Get one task
# @name taskGetOne
GET {{host}}/tasks/{{taskCreate.response.body.id}}
Content-Type: application/json
Authorization: Bearer {{userLogin.response.body.access}}
### Update task
# @name taskUpdate
PATCH {{host}}/tasks/{{taskCreate.response.body.id}}
Content-Type: application/json
Authorization: Bearer {{userLogin.response.body.access}}
{
"done": true
}
### Delete task
# @name taskDelete
DELETE {{host}}/tasks/{{taskCreate.response.body.id}}
Content-Type: application/json
Authorization: Bearer {{userLogin.response.body.access}}