-
Notifications
You must be signed in to change notification settings - Fork 1
/
.http
111 lines (90 loc) · 2.08 KB
/
.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
@host = http://localhost:3000
### Register new user
POST {{host}}/register
Content-Type: application/json
{
"username": "food@recipe",
"password": "yummyfoodie"
}
### Login user
# @name login
POST {{host}}/login
Content-Type: application/json
{
"username": "food@recipe",
"password": "yummyfoodie"
}
### Get all the lists
GET {{host}}/myLists
Authorization: Bearer {{token}}
Content-Type: application/json
### Gets a specific list
GET {{host}}/myLists/3
Authorization: Bearer {{token}}
Content-Type: application/json
### Post a new list if logged in
@token = {{login.response.body.token}}
POST {{host}}/myLists
Authorization: Bearer {{token}}
Content-Type: application/json
{
"name": "Comedy",
"ownerId": 1,
"description": "loremipsuslistsoffoodteam",
"listIds": [5,10,15]
}
### Update list by ID
PATCH {{host}}/myLists/5
Authorization: Bearer {{token}}
Content-Type: application/json
{
"name": "Comedy",
"ownerId": 2,
"description": "loremipsuslistsoffoodteam",
"listIds": [1, 2, 3]
}
### Delete a list
DELETE {{host}}/myLists/2
Authorization: Bearer {{token}}
### Get list of all items
GET {{host}}/listItems
Authorization: Bearer {{token}}
Content-Type: application/json
### Get a specific item
GET {{host}}/listItems/5
Authorization: Bearer {{token}}
Content-Type: application/json
### Item does not exist
GET {{host}}/listItems/400
Authorization: Bearer {{token}}
Content-Type: application/json
### Update an existing list's info
PATCH {{host}}/listItems/11
Authorization: Bearer {{token}}
Content-Type: application/json
{
"itemName": "Yummy",
"myListId": 1
}
### Create a list
POST {{host}}/listItems
Authorization: Bearer {{token}}
Content-Type: application/json
{
"itemName": "Yummy",
"myListId": 9
}
### Delete an item
DELETE {{host}}/listItems/15
Authorization: Bearer {{token}}
### Get Items
GET {{host}}/shopping/items
Authorization: Bearer {{token}}
Content-Type: application/json
### Calculate Cart Total
POST {{host}}/shopping/cart
Authorization: Bearer {{token}}
Content-Type: application/json
{
"selectedItems": [1, 3]
}