forked from HaoweiCh/go-casbin-http-authrozation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.http
57 lines (44 loc) · 1.29 KB
/
README.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
### 登陆用户
POST {{HOST}}/login
Content-Type: application/x-www-form-urlencoded
name=Admin
> {%
client.assert(response.status === 200, "Response status is not 200");
client.global.set("SESSION_ID", response.headers.valuesOf("Set-Cookie")[0]);
client.log( client.global.get("SESSION_ID"));
%}
### 登陆用户
POST {{HOST}}/login
Content-Type: application/x-www-form-urlencoded
name=Sabine
> {%
client.assert(response.status === 200, "Response status is not 200");
client.global.set("SESSION_ID", response.headers.valuesOf("Set-Cookie")[0]);
client.log( client.global.get("SESSION_ID"));
%}
### 登陆用户
POST {{HOST}}/login
Content-Type: application/x-www-form-urlencoded
name=Sepp
> {%
client.assert(response.status === 200, "Response status is not 200");
client.global.set("SESSION_ID", response.headers.valuesOf("Set-Cookie")[0]);
client.log( client.global.get("SESSION_ID"));
%}
### 当前用户
GET {{HOST}}/member/current
Accept: application/json
Cookie: {{SESSION_ID}}
### 当前用户角色
GET {{HOST}}/member/role
Accept: application/json
Cookie: {{SESSION_ID}}
### 管理员用户才可以访问的页面
GET {{HOST}}/admin/stuff
Accept: application/json
Cookie: {{SESSION_ID}}
### 登出
POST {{HOST}}/logout
Content-Type: application/x-www-form-urlencoded
Cookie: {{SESSION_ID}}
###