forked from davert0/python-clean-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.http
More file actions
114 lines (78 loc) · 1.85 KB
/
api.http
File metadata and controls
114 lines (78 loc) · 1.85 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
### Python Clean Architecture API
### Используй REST Client extension для VS Code
### https://marketplace.visualstudio.com/items?itemName=humao.rest-client
@host = http://localhost:8000
@contentType = application/json
###
### Health Check
GET {{host}}/health
###
### Создать пользователя
POST {{host}}/users/
Content-Type: {{contentType}}
{
"email": "john.doe@example.com",
"name": "John Doe"
}
###
### Создать ещё пользователей
POST {{host}}/users/
Content-Type: {{contentType}}
{
"email": "jane.smith@example.com",
"name": "Jane Smith"
}
###
### Получить пользователя по ID
GET {{host}}/users/1
###
### Получить всех пользователей
GET {{host}}/users/
###
### Получить пользователей с пагинацией
GET {{host}}/users/?limit=10&offset=0
###
### Обновить пользователя
PUT {{host}}/users/1
Content-Type: {{contentType}}
{
"name": "John Updated Doe"
}
###
### Обновить email
PUT {{host}}/users/1
Content-Type: {{contentType}}
{
"email": "john.updated@example.com"
}
###
### Обновить и имя и email
PUT {{host}}/users/1
Content-Type: {{contentType}}
{
"email": "john.final@example.com",
"name": "John Final"
}
###
### Удалить пользователя
DELETE {{host}}/users/1
###
### Попытка получить несуществующего пользователя (404)
GET {{host}}/users/999
###
### Попытка создать пользователя с дубликатом email (409)
POST {{host}}/users/
Content-Type: {{contentType}}
{
"email": "jane.smith@example.com",
"name": "Another Jane"
}
###
### Невалидный email (422)
POST {{host}}/users/
Content-Type: {{contentType}}
{
"email": "not-an-email",
"name": "Test User"
}
###