-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestrest.http
62 lines (43 loc) · 2.24 KB
/
testrest.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
POST http://localhost:5000/user/login
Content-Type: application/json
{
"username": "again100",
"password": "123"
}
### Authorization by token, part 2. Use token to authorize.
GET http://localhost:5000/user/protected
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MjcyNTg4MzYsImV4cCI6MTUyNzM0NTIzNiwicmZfZXhwIjoxNTI5ODUwODM2LCJqdGkiOiI3MzYzMzBmYy05YmY5LTRiYzctOWFkMC0yODNiOGE5NjE3ZTYiLCJpZCI6MywicmxzIjoiY2FuX25vdGhpbmcifQ.QfTOc0xJrkQnBjS7gN5wxucsvr8NeGQzlYQcKJOF9oQ
###
GET http://localhost:5000/user/protected_admin_required
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MjcxOTUzNzAsImV4cCI6MTUyNzI4MTc3MCwicmZfZXhwIjoxNTI5Nzg3MzcwLCJqdGkiOiJlY2JkNTU1Yy0zNTY5LTRmZmQtOTU1Zi1hZjBmZWNkMDQ2MzYiLCJpZCI6MywicmxzIjoiY2FuX25vdGhpbmcifQ.Yky5oaL7lS3lrRtAB5f_dMLW2crMpWo9rmlpfWUx17Y
###
GET http://localhost:5000/user/protected_operator_accepted
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MjcxOTUzNzAsImV4cCI6MTUyNzI4MTc3MCwicmZfZXhwIjoxNTI5Nzg3MzcwLCJqdGkiOiJlY2JkNTU1Yy0zNTY5LTRmZmQtOTU1Zi1hZjBmZWNkMDQ2MzYiLCJpZCI6MywicmxzIjoiY2FuX25vdGhpbmcifQ.Yky5oaL7lS3lrRtAB5f_dMLW2crMpWo9rmlpfWUx17Y
###
GET http://localhost:5000/user/refresh
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MjcyNTg4MzYsImV4cCI6MTUyNzM0NTIzNiwicmZfZXhwIjoxNTI5ODUwODM2LCJqdGkiOiI3MzYzMzBmYy05YmY5LTRiYzctOWFkMC0yODNiOGE5NjE3ZTYiLCJpZCI6MywicmxzIjoiY2FuX25vdGhpbmcifQ.QfTOc0xJrkQnBjS7gN5wxucsvr8NeGQzlYQcKJOF9oQ
###
POST http://localhost:5000/user/disable_user
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MjcyNTg4MzYsImV4cCI6MTUyNzM0NTIzNiwicmZfZXhwIjoxNTI5ODUwODM2LCJqdGkiOiI3MzYzMzBmYy05YmY5LTRiYzctOWFkMC0yODNiOGE5NjE3ZTYiLCJpZCI6MywicmxzIjoiY2FuX25vdGhpbmcifQ.QfTOc0xJrkQnBjS7gN5wxucsvr8NeGQzlYQcKJOF9oQ
{
"username": "again100"
}
###
GET http://localhost:5000/user
Content-Type: application/json
###
GET http://localhost:5000/user/usernames
Content-Type: application/json
### Send POST request with json body
POST http://localhost:5000/user
Content-Type: application/json
{
"username": "again10",
"name": "Layth Again",
"email": "[email protected]",
"password": "123",
"password_again": "123",
"roles": "can_nothing"
}
###