-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathclient.http
More file actions
139 lines (104 loc) · 2.58 KB
/
client.http
File metadata and controls
139 lines (104 loc) · 2.58 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
127
128
129
130
131
132
133
134
135
136
137
138
139
@baseUrl = http://localhost:3000/api
@contentType = application/json
###
# Obtener todos los héroes
GET {{baseUrl}}/heroes
Accept: {{contentType}}
###
# @name addSpiderMan
# Crear héroe: Spider-Man (Marvel)
POST {{baseUrl}}/heroes
Content-Type: {{contentType}}
{
"name": "Spider-Man",
"power": "Poderes arácnidos, sentido arácnido, fuerza sobrehumana",
"universe": "Marvel",
"isActive": true
}
###
# Recuperar el id del héroe creado
@spiderman_id = {{ addSpiderMan.response.body.data.id }}
###
# Recuperar el héroe por ID
GET {{baseUrl}}/heroes/{{spiderman_id}}
Accept: {{contentType}}
###
# @name addBatman
# Crear héroe: Batman (DC)
POST {{baseUrl}}/heroes
Content-Type: {{contentType}}
{
"name": "Batman",
"power": "Intelecto, artes marciales, tecnología avanzada",
"universe": "DC",
"isActive": true
}
###
@batman_id = {{ addBatman.response.body.data.id }}
###
# @name addWonderWoman
# Crear héroe: Wonder Woman (DC)
POST {{baseUrl}}/heroes
Content-Type: {{contentType}}
{
"name": "Wonder Woman",
"power": "Fuerza, agilidad, lazo de la verdad",
"universe": "DC",
"isActive": true
}
###
@wonderwoman_id = {{ addWonderWoman.response.body.data.id }}
###
# @name addIronMan
# Crear héroe: Iron Man (Marvel)
POST {{baseUrl}}/heroes
Content-Type: {{contentType}}
{
"name": "Iron Man",
"power": "Armadura tecnológica, genio inventor",
"universe": "Marvel",
"isActive": true
}
###
@ironman_id = {{ addIronMan.response.body.data.id }}
###
# Obtener héroes filtrando por universo (Marvel)
GET {{baseUrl}}/heroes?universe=Marvel
Accept: {{contentType}}
###
# Actualizar héroe (usar el ID del héroe creado anteriormente)
PUT {{baseUrl}}/heroes/{{spiderman_id}}
Content-Type: {{contentType}}
{
"name": "Spider-Man",
"power": "Poderes arácnidos mejorados, sentido arácnido, telarañas orgánicas",
"universe": "Marvel",
"isActive": true
}
###
# Eliminar héroe (usar el ID del héroe creado anteriormente)
DELETE {{baseUrl}}/heroes/{{spiderman_id}}
Accept: {{contentType}}
###
# Operaciones adicionales con ObjectIds dinámicos
# Actualizar Batman
PUT {{baseUrl}}/heroes/{{batman_id}}
Content-Type: {{contentType}}
{
"name": "Batman",
"power": "Intelecto superior, artes marciales, tecnología avanzada, detective",
"universe": "DC",
"isActive": true
}
###
# Obtener Wonder Woman por ID
GET {{baseUrl}}/heroes/{{wonderwoman_id}}
Accept: {{contentType}}
###
# Eliminar Iron Man
DELETE {{baseUrl}}/heroes/{{ironman_id}}
Accept: {{contentType}}
###
# Obtener los héroes que han sobrevivido a mis pruebas 😇
GET {{baseUrl}}/heroes
Accept: {{contentType}}