-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.http
58 lines (42 loc) · 1006 Bytes
/
.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
@host = http://localhost:3000
### Register new customer
POST {{host}}/register
Content-Type: application/json
{
"username": "[email protected]",
"password": "foobar"
}
### Login
# @name login
POST {{host}}/login
Content-Type: application/json
{
"username": "[email protected]",
"password": "foobar"
}
### Get all products
@token = {{login.response.body.token}}
GET {{host}}/products
Authorization: Bearer {{token}}
### Get a specific product
@token = {{login.response.body.token}}
GET {{host}}/products/1
Authorization: Bearer {{token}}
### Add new order
@token = {{login.response.body.token}}
POST {{host}}/orders
Authorization: Bearer {{token}}
Content-Type: application/json
{
"date": "2024-12-04",
"note": "Add new order",
"productIds": [1, 2, 3]
}
### Get all orders
@token = {{login.response.body.token}}
GET {{host}}/orders
Authorization: Bearer {{token}}
### Get a specific order
@token = {{login.response.body.token}}
GET {{host}}/orders/6
Authorization: Bearer {{token}}