-
Notifications
You must be signed in to change notification settings - Fork 0
/
curl.sh
116 lines (92 loc) · 2.29 KB
/
curl.sh
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
curl -X GET "localhost:8080/orders"
curl -X POST "localhost:8080/orders" -H 'Content-Type: application/json' -d'
{
"first": "away",
"last": "contain",
"middle": "avoid",
"number_shipped": 3174,
"order_date": "2021-10-16",
"product_id": 4492,
"title": "forget"
}
'
curl -X POST "localhost:8080/orders/910" -H 'Content-Type: application/json' -d'
{
"first": "away",
"id": 910,
"last": "contain",
"middle": "avoid",
"number_shipped": 3174,
"order_date": "2021-10-16",
"product_id": 4492,
"title": "forget"
}
'
curl -X GET "localhost:8080/orders/910"
curl -X DELETE "localhost:8080/orders/910"
# --
curl -X GET "localhost:8080/products"
curl -X POST "localhost:8080/products" -H 'Content-Type: application/json' -d'
{
"inventory_on_hand": 8025,
"inventory_received": 1032,
"inventory_shipped": 6313,
"minimum_required": 8029,
"part_number": "stay",
"product_label": "customer",
"product_name": "environment",
"starting_inventory": 8932
}
'
curl -X POST "localhost:8080/products/845" -H 'Content-Type: application/json' -d'
{
"id": 845,
"inventory_on_hand": 8025,
"inventory_received": 1032,
"inventory_shipped": 6313,
"minimum_required": 8029,
"part_number": "stay",
"product_label": "customer",
"product_name": "environment",
"starting_inventory": 8932
}
'
curl -X GET "localhost:8080/products/845"
curl -X DELETE "localhost:8080/products/845"
# --
curl -X GET "localhost:8080/purchases"
curl -X POST "localhost:8080/purchases" -H 'Content-Type: application/json' -d'
{
"number_received": 3185,
"product_id": 5326,
"purchase_date": "2021-09-21",
"supplier_id": 5821
}
'
curl -X POST "localhost:8080/purchases/4860" -H 'Content-Type: application/json' -d'
{
"id": 4860,
"number_received": 3185,
"product_id": 5326,
"purchase_date": "2021-09-21",
"supplier_id": 5821
}
'
curl -X GET "localhost:8080/purchases/4860"
curl -X DELETE "localhost:8080/purchases/4860"
# --
curl -X GET "localhost:8080/suppliers"
curl -X POST "localhost:8080/suppliers" -H 'Content-Type: application/json' -d'
{
"supplier": "course"
}
'
curl -X POST "localhost:8080/suppliers/1502" -H 'Content-Type: application/json' -d'
{
"id": 1502,
"supplier": "course"
}
'
curl -X GET "localhost:8080/suppliers/1502"
curl -X DELETE "localhost:8080/suppliers/1502"
# --