-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcurl.txt
38 lines (33 loc) · 913 Bytes
/
curl.txt
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
// get list
curl --request GET \
--url http://localhost:8000/api/inventory
// save item
curl --request PUT \
--url http://localhost:8000/api/inventory \
--header 'Content-Type: application/json' \
--data '{
"name": "item name",
"description": "desc for the item",
"priceCents": 35487546,
"inventoryCount": 1
}'
// update item
curl --request PUT \
--url http://localhost:8000/api/inventory/<YOUR ITEM ID> \
--header 'Content-Type: application/json' \
--data '{
"description": "new description"
}'
// delete item
curl --request DELETE \
--url http://localhost:8000/api/inventory/<YOUR ITEM ID> \
--header 'Content-Type: application/json' \
--data '{
"reason": "deletion reason"
}'
// show deleted items
curl --request GET \
--url http://localhost:8000/api/inventory/archive
// undelete an item
curl --request POST \
--url http://localhost:8000/api/inventory/restore/<YOUR ITEM ID>