-
Notifications
You must be signed in to change notification settings - Fork 201
/
mock.http
80 lines (61 loc) · 1.63 KB
/
mock.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
// ## /auth
@api_base = http://localhost:3000/api
@access_token = 17dfbf0dd1c116a217dfbf0dd1c16907
@refresh_token = 17dfb982a9b1a16c17dfb982a9b1cca3
# ==============================================================================
### menus request
GET {{api_base}}/menus HTTP/1.1
authorization: Bearer {{access_token}}
# ==============================================================================
### password grant success
POST {{api_base}}/auth/token HTTP/1.1
content-type: application/json
{
"grant_type": "password",
"username": "zce",
"password": "wanglei"
}
### password grant failed
POST {{api_base}}/auth/token HTTP/1.1
content-type: application/json
{
"grant_type": "password",
"username": "zce",
"password": "wanglei1"
}
### refresh token success
POST {{api_base}}/auth/token HTTP/1.1
content-type: application/json
{
"grant_type": "refresh_token",
"refresh_token": "{{refresh_token}}"
}
### refresh token failed
POST {{api_base}}/auth/token HTTP/1.1
content-type: application/json
{
"grant_type": "refresh_token",
"refresh_token": "invalid token"
}
### invalid grant type
POST {{api_base}}/auth/token HTTP/1.1
content-type: application/json
{
"grant_type": "foo"
}
### revoke refresh token success
DELETE {{api_base}}/auth/token HTTP/1.1
content-type: application/json
{
"token": "17b1ac3005b18f3f17b1ac3005b1cb22"
}
### revoke refresh token failed
DELETE {{api_base}}/auth/token HTTP/1.1
content-type: application/json
{
"token": "foo"
}
# ==============================================================================
### Playground
GET https://api.github.com/gists/starred HTTP/1.1
Authorization: Bearer sssss