-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.http
91 lines (70 loc) · 1.76 KB
/
example.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
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
# Use case: Register a car
POST http://localhost:8080/index.php/cars
Content-Type: application/json
{
"uuid": "34d08fb6-9af3-4a96-90b0-8e98aa299b0f",
"brand": "Ford",
"model": "Focus",
"year": 2021,
"patent": "AB123CD",
"color": "Azul"
}
###
# Use case: Update a car
PUT http://localhost:8080/index.php/cars/34d08fb6-9af3-4a96-90b0-8e98aa299b0f
Content-Type: application/json
{
"brand": "Ford",
"model": "Focus",
"year": 2015,
"patent": "DC321BA",
"color": "Verde"
}
###
# Use case: Register an owner
POST http://localhost:8080/index.php/owners
Content-Type: application/json
{
"uuid": "799d370f-4c66-4a88-a8ef-973f29ffc1f1",
"dni": "12345678",
"surname": "Perez",
"name": "Eusebia"
}
###
# Use case: Set car owner
PUT http://localhost:8080/index.php/cars/34d08fb6-9af3-4a96-90b0-8e98aa299b0f/owner/799d370f-4c66-4a88-a8ef-973f29ffc1f1
###
# Use case: Get all cars with owner
#
# Get all cars. Accept limit and offset.
# By default limit = 10 and offset = 0
GET http://localhost:8080/index.php/cars
Accept: application/json
###
GET http://localhost:8080/index.php/cars?limit=5&offset=0
Accept: application/json
###
# Use case: Get one car with owner
GET http://localhost:8080/index.php/cars/34d08fb6-9af3-4a96-90b0-8e98aa299b0f
Accept: application/json
###
# Use case: Register transaction
POST http://localhost:8080/index.php/cars/34d08fb6-9af3-4a96-90b0-8e98aa299b0f/transactions
Content-Type: application/json
{
"uuid": "78da0efc-405b-4477-9e33-e296a321cd5a",
"services": [
{
"service": "Cambio de Aceite",
"price": 5467.00
},
{
"service": "Revisión General",
"price": 3000.00
}
]
}
###
# Use case: Delete one car
DELETE http://localhost:8080/index.php/cars/34d08fb6-9af3-4a96-90b0-8e98aa299b0f
###