-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrest.http
59 lines (35 loc) · 900 Bytes
/
rest.http
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
GET http://localhost:3000/products
### create a product
POST http://localhost:3000/products
Content-Type: application/json
{
"name": "Vivo T2 -x nw",
"price": 13999
}
### get a product by id
GET http://localhost:3000/products/652667dd62eff537abbaa1b8
### update a product by id
PATCH http://localhost:3000/products/64cf470e3cf25bcafc40b3fe
Content-Type: application/json
{
"price": 1249
}
### delete a product by id
DELETE http://localhost:3000/products/64de24bf75dd66fda472c765
### 404 route Not found
GET http://localhost:3000/abc_xyz
###
GET http://localhost:3000/test?name=iMac&price=2399
###
GET http://localhost:3000/test/76899999/imac
###
POST http://localhost:3000/test
Content-Type: application/json
{
"name": "imacPro",
"price": 4999
}
###
POST http://localhost:3000/test
Content-Type:application/x-www-form-urlencoded
name=iMac&price=4999