-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequests.http
More file actions
126 lines (80 loc) · 2.83 KB
/
Copy pathrequests.http
File metadata and controls
126 lines (80 loc) · 2.83 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
124
125
126
### Root
GET http://localhost:1198/
### Health Check
GET http://localhost:1198/api/v1/health
### Get All Products
GET http://localhost:1198/api/v1/products
### Get Products With Pagination
GET http://localhost:1198/api/v1/products?page=1&limit=2
### Search Products
GET http://localhost:1198/api/v1/products?search=Wireless
### Filter By Category
GET http://localhost:1198/api/v1/products?category=Accessories
### Filter By Price Range
GET http://localhost:1198/api/v1/products?minPrice=2000&maxPrice=2800
### Filter By Stock
GET http://localhost:1198/api/v1/products?inStock=false
### Sort By Price Ascending
GET http://localhost:1198/api/v1/products?sort=price&order=asc
### Sort By Price Descending
GET http://localhost:1198/api/v1/products?sort=price&order=desc
### Include Soft Deleted Products
GET http://localhost:1198/api/v1/products?includeDeleted=true
### Combined Query
GET http://localhost:1198/api/v1/products?search=keyboard&category=Accessories&inStock=true&sort=price&order=desc&page=1&limit=1
### Create Product
POST http://localhost:1198/api/v1/products
Content-Type: application/json
{
"name": "Wireless Keyboard create",
"description": "Compact wireless keyboard for everyday productivity.",
"category": "Accessories",
"price": 2499,
"inStock": true
}
### Create Another Product
POST http://localhost:1198/api/v1/products
Content-Type: application/json
{
"name": "Portable SSD another",
"description": "High-speed portable SSD for backups and file transfers.",
"category": "Storage",
"price": 6999,
"inStock": true
}
### Get Product By ID
### Replace PRODUCT_ID with a real MongoDB document ID
GET http://localhost:1198/api/v1/products/6a81f6affc67e5f7c9c68290
### Update Product
### Replace PRODUCT_ID with a real MongoDB document ID
PUT http://localhost:1198/api/v1/products/6a81f6affc67e5f7c9c68290
Content-Type: application/json
{
"name": "Premium Wireless Keyboard another",
"description": "Premium compact wireless keyboard for everyday productivity.",
"category": "Accessories",
"price": 2999,
"inStock": true
}
### Soft Delete Product
### Replace PRODUCT_ID with a real MongoDB document ID
DELETE http://localhost:1198/api/v1/products/6a81f6affc67e5f7c9c68290
### Restore Product
### Replace PRODUCT_ID with a previously soft-deleted MongoDB document ID
PATCH http://localhost:1198/api/v1/products/6a81f6affc67e5f7c9c68290/restore
### Invalid Product ID
GET http://localhost:1198/api/v1/products/6a81f6affc67e5f7c9c68290-id
### Invalid Product Input
POST http://localhost:1198/api/v1/products
Content-Type: application/json
{
"name": "",
"description": "No",
"category": "",
"price": -10,
"inStock": "yes"
}
### Invalid Query
GET http://localhost:1198/api/v1/products?page=0&limit=500
### Invalid Route
GET http://localhost:1198/api/v1/not-found