forked from ironhack-labs/lab-java-springboot-rest-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequestsLabHTTP.http
More file actions
79 lines (61 loc) · 1.79 KB
/
requestsLabHTTP.http
File metadata and controls
79 lines (61 loc) · 1.79 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
### --- PRODUCT ENDPOINTS (port 8080) ---
### Create a new product & update the QTY if exist the product
POST http://localhost:8080/products
API-Key: 123456
Content-Type: application/json
{
"name": "GITHUB COPILOT SUBSCRIPTION YEARLY",
"price": 100.0,
"category": "SOFTWARE",
"quantity": 50
}
### Get all products
GET http://localhost:8080/products
API-Key: 123456
### Get product by name
GET http://localhost:8080/products/github copilot subscription yearly
API-Key: 123456
### Update product
PUT http://localhost:8080/products/github copilot subscription yearly
API-Key: 123456
Content-Type: application/json
{
"name": "GITHUB COPILOT SUBSCRIPTION YEARLY",
"price": 199.0,
"category": "SUBSCRIPTION",
"quantity": 100
}
### Delete product
DELETE http://localhost:8080/products/github copilot subscription yearly
API-Key: 123456
### Get products by category
GET http://localhost:8080/products/category/SUBSCRIPTION
API-Key: 123456
### Get products by price range
GET http://localhost:8080/products/price?min=100&max=200
API-Key: 123456
### --- CUSTOMER ENDPOINTS (port 8080) ---
### Create a new customer "verifiying the email does not exist".
POST http://localhost:8080/customers
Content-Type: application/json
{
"name": "Manu",
"email": "manu@example.com",
"age": 25,
"address": "Calle Falsa 123"
}
### Get all customers
GET http://localhost:8080/customers
### Get customer by email
GET http://localhost:8080/customers/manu@example.com
### Update customer "but does not update the email because is the identifier of the customer"
PUT http://localhost:8080/customers/manu@example.com
Content-Type: application/json
{
"name": "Manu Candela",
"email": "manu@exam.com",
"age": 26,
"address": "Calle Nueva 456"
}
### Delete customer
DELETE http://localhost:8080/customers/manu@example.com