-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.http
More file actions
89 lines (62 loc) · 1.45 KB
/
test.http
File metadata and controls
89 lines (62 loc) · 1.45 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
### Create Data
POST http://localhost:3000/api/products
Content-Type: application/json
Accept: application/json
{
"id": "1",
"name": "Laptop 455X",
"price": "4.000.000",
"quantity": "1"
}
### Create Data Invalid
POST http://localhost:3000/api/products
Content-Type: application/json
Accept: application/json
{
"id": "1",
"name": "",
"price": -1,
"quantity": -1
}
### Get Data By Id
GET http://localhost:3000/api/products/1
Content-Type: application/json
### Get Data By Id Not Found
GET http://localhost:3000/api/products/notfound
Content-Type: application/json
### Update product
PUT http://localhost:3000/api/products/4
Content-Type: application/json
Accept: application/json
{
"name" : "Apple Mac Book Pro 15 2020",
"price" : 40000000,
"quantity" : 100
}
### Update product not found
PUT http://localhost:3000/api/products/NOTFOUND
Content-Type: application/json
Accept: application/json
{
"name" : "Apple Mac Book Pro 15 2020",
"price" : 40000000,
"quantity" : 100
}
### Update product with invalid body
PUT http://localhost:3000/api/products/4
Content-Type: application/json
Accept: application/json
{
"name" : "",
"price" : 0,
"quantity" : -10
}
### Delete product
DELETE http://localhost:3000/api/products/3
Accept: application/json
### Delete product id not found
DELETE http://localhost:3000/api/products/NOTFOUND
Accept: application/json
### List products
GET http://localhost:3000/api/products
Accept: application/json