-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.rest
More file actions
123 lines (108 loc) · 2.44 KB
/
Copy path.rest
File metadata and controls
123 lines (108 loc) · 2.44 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
@baseUrl = http://localhost:3001/rest
@contentType = application/json
###
# @name getItems
# Get all items
GET {{baseUrl}}/items
###
# @name getItemsFiltered
# Get filtered items
# @prompt search enter the search term
# @prompt limit enter the limit
GET {{baseUrl}}/items?search={{search}}&limit={{limit}}
###
# @name getItem
# Get an item
# @prompt id enter the item id
GET {{baseUrl}}/items/{{id}}
###
# @name getItemCategories
# Get an item categories
# @prompt id enter the item id
GET {{baseUrl}}/items/{{id}}/categories
###
# @name createItems
# Create new items
# @prompt name1 enter the item name 1
# @prompt categoryId1 enter the item category id 1
# @prompt name2 enter the item name 2
# @prompt categoryId2 enter the item category id 2
POST {{baseUrl}}/items HTTP/1.1
Content-Type: {{contentType}}
[
{
"name": "{{name1}}",
"categoryId": "{{categoryId1}}"
},
{
"name": "{{name2}}",
"categoryId": "{{categoryId2}}"
}
]
###
# @name createItem
# Create new item
# @prompt name enter the item name
# @prompt categoryId enter the item category id
POST {{baseUrl}}/items HTTP/1.1
Content-Type: {{contentType}}
{
"name": "{{name}}",
"categoryId": "{{categoryId}}"
}
###
# @name updateItems
# Update existing items
# @prompt id1 enter the item id 1
# @prompt name1 enter the item name 1
# @prompt categoryId1 enter the item category id 1
# @prompt id2 enter the item id 2
# @prompt name2 enter the item name 2
# @prompt categoryId2 enter the item category id 2
PUT {{baseUrl}}/items HTTP/1.1
Content-Type: {{contentType}}
[
{
"id": "{{id1}}",
"name": "{{name1}}",
"categoryId": "{{categoryId1}}"
},
{
"id": "{{id2}}",
"name": "{{name2}}",
"categoryId": "{{categoryId2}}"
}
]
###
# @name updateItem
# Update an existing item
# @prompt id enter the item id
# @prompt name enter the item name
# @prompt categoryId enter the item category id
PUT {{baseUrl}}/items/{{id}} HTTP/1.1
Content-Type: {{contentType}}
{
"id": "{{id}}",
"name": "{{name}}",
"categoryId": "{{categoryId}}"
}
###
# @name deleteItems
# Delete existing items
# @prompt id1 enter the item id 1
# @prompt id2 enter the item id 2
DELETE {{baseUrl}}/items HTTP/1.1
Content-Type: {{contentType}}
[
{
"id": "{{id1}}"
},
{
"id": "{{id2}}"
}
]
###
# @name deleteItem
# Delete an existing item
# @prompt id enter the item id
DELETE {{baseUrl}}/items/{{id}}