-
Notifications
You must be signed in to change notification settings - Fork 0
/
request.http
64 lines (53 loc) · 1.35 KB
/
request.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
GET https://localhost:1323
###
# @name newUserSignUp
POST https://localhost:1323/signup
Content-Type: application/json
{
"username":"addetz",
"password":"purple-puffin-123"
}
###
# @name userLogin
POST https://localhost:1323/login
Content-Type: application/json
{
"username":"addetz",
"password":"purple-puffin-123"
}
###
# @name restrictedPath
@jwt = {{userLogin.response.body.token}}
GET https://localhost:1323/restricted
Authorization: Bearer {{jwt}}
###
# @name addSecretNote
@user = {{userLogin.request.body.username}}
@jwt = {{userLogin.response.body.token}}
POST https://localhost:1323/restricted/secretNotes/{{user}}
Content-Type: application/json
Authorization: Bearer {{jwt}}
{
"username":"{{user}}",
"text":"I'm excited to be at GopherCon again!"
}
###
# @name getSecretNotes
@user = {{userLogin.request.body.username}}
@jwt = {{userLogin.response.body.token}}
GET https://localhost:1323/restricted/secretNotes/{{user}}
Authorization: Bearer {{jwt}}
###
# @name hackerSignup
POST https://localhost:1323/signup
Content-Type: application/json
{
"username":"hacker",
"password":"gimme-notes-mwahaha-1234"
}
###
# @name getSecretNotes
@user = {{userLogin.request.body.username}}
@hacker_jwt = {{hackerSignup.response.body.token}}
GET https://localhost:1323/restricted/secretNotes/{{user}}
Authorization: Bearer {{hacker_jwt}}