-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAPI.http
49 lines (37 loc) · 912 Bytes
/
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
@baseUrl = http://localhost:8888
@token = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVlYjliY2EwYmFiYTJlMzA5MDZiNGJjMyIsImlhdCI6MTU4OTIzMTAxMCwiZXhwIjoxNTkxODIzMDEwfQ.XWDAy-ba5W3DgcGB4lq12QgpeH6_zwO9hfXxNi0aXUw
@userId =
###
# @name loginUser
// Login user
POST {{baseUrl}}/api/login HTTP/1.1
Content-Type: application/json
{
"email":"[email protected]",
"password":"password"
}
###
# @name CreateUser
// Register A User
POST {{baseUrl}}/api/register HTTP/1.1
Content-Type: application/json
{
"name": "chad",
"email": "[email protected]",
"password": "password"
}
###
# @name getMe
// get user from Bearer token
GET {{baseUrl}}/api/user HTTP/1.1
Content-Type: application/json
Authorization: Bearer {{token}}
###
# @name updateUser
// Update A user
PUT {{baseUrl}}/api/user HTTP/1.1
Content-Type: application/json
Authorization: Bearer {{token}}
{
"role":"admin"
}