-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_api.http
169 lines (122 loc) · 3.39 KB
/
test_api.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
POST http://127.0.0.1:5000/auth/register
Accept: application/json
Content-Type: application/json
{
"email": "alex_m@mail.ru",
"password": "P@ssw0rdwow"
}
###
POST http://127.0.0.1:5000/auth/login
Accept: application/json
Content-Type: application/json
{
"email": "alex_m@mail.ru",
"password": "P@ssw0rdwow"
}
###
PUT http://127.0.0.1:5000/auth/login
Accept: application/json
Content-Type: application/json
{
"access_token": "JWT_REFRESH_TOKEN",
"refresh_token": "JWT_REFRESH_TOKEN"
}
###
GET http://127.0.0.1:5000/movies/
Accept: application/json
Authorization: Here put Token (access_token or refresh_token)
###
GET http://127.0.0.1:5000/movies/6
Accept: application/json
Authorization: Here put Token (access_token or refresh_token)
###
GET http://127.0.0.1:5000/movies/?status=new&page=1
Accept: application/json
Authorization: Here put Token (access_token or refresh_token)
###
GET http://127.0.0.1:5000/movies/?page=2
Accept: application/json
Authorization: Here put Token (access_token or refresh_token)
###
GET http://127.0.0.1:5000/directors/
Accept: application/json
Authorization: Here put Token (access_token or refresh_token)
###
GET http://127.0.0.1:5000/directors/1
Accept: application/json
Authorization: Here put Token (access_token or refresh_token)
###
GET http://127.0.0.1:5000/directors/?page=1
Accept: application/json
Authorization: Here put Token (access_token or refresh_token)
###
GET http://127.0.0.1:5000/genres/
Accept: application/json
Authorization: Here put Token (access_token or refresh_token)
###
GET http://127.0.0.1:5000/genres/1
Accept: application/json
Authorization: Here put Token (access_token or refresh_token)
###
GET http://127.0.0.1:5000/genres/?page=1
Accept: application/json
Authorization: Here put Token (access_token or refresh_token)
###
POST http://127.0.0.1:5000/movies/
Accept: application/json
Content-Type: application/json
Authorization: Here put Token (access_token or refresh_token)
{
"title": "Гарри Поттер мой кумир!",
"trailer": "Таким фильмам не нужны трейлеры",
"year": 1990,
"rating": 10,
"description": "10 из 10!"
}
###
PUT http://127.0.0.1:5000/movies/22
Accept: application/json
Content-Type: application/json
Authorization: Here put Token (access_token or refresh_token)
{
"id": 22,
"title": "-------",
"trailer": "-----",
"year": 0,
"rating": 0,
"description": "0 из 10!",
"genre_id": 1,
"director_id": 1
}
###
DELETE http://127.0.0.1:5000/movies/22
Authorization: Here put Token (access_token or refresh_token)
###
GET http://127.0.0.1:5000/users/
Accept: application/json
Authorization: Here put Token (access_token or refresh_token)
###
GET http://127.0.0.1:5000/users/3
Accept: application/json
Authorization: Here put Token (access_token or refresh_token)
###
PATCH http://127.0.0.1:5000/users/3
Accept: application/json
Content-Type: application/json
Authorization: Here put Token (access_token or refresh_token)
{
"email": "sam66_ortega@mail.ru",
"surname": "Ortega",
"name": "Samuel"
}
###
PUT http://127.0.0.1:5000/users/password
Accept: application/json
Content-Type: application/json
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImFsZXhAbWFpbC5ydSIsImV4cCI6MTY4NTAyMjM5NX0.czsDCcmWDCWkTW89KV-BoHBDSnkKhDH7lOlvI67T1bI
{
"email": "sam66_ortega@mail.ru",
"old_password": "luck1",
"new_password": "luck2"
}
###