-
Notifications
You must be signed in to change notification settings - Fork 1
/
monster_brawl.http
89 lines (60 loc) · 1.83 KB
/
monster_brawl.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
@hostname = 127.0.0.1
@port = 8000
@baseUrl = http://{{hostname}}:{{port}}
@apiUrl = {{baseUrl}}/api
@contentType = application/json
@monsterId = 094c58a0-73a1-44e7-90c0-1d56d019520f
@battleId = 4dfb6f55-c6ca-4b92-a01b-ad88fc89ccab
### Healthcheck
GET {{baseUrl}}/healthcheck HTTP/1.1
### Not found
GET {{baseUrl}}/not-found HTTP/1.1
### Get all monsters
GET {{apiUrl}}/monsters HTTP/1.1
### Get a monster by id
GET {{apiUrl}}/monsters/{{monsterId}} HTTP/1.1
### Create a new monster
POST {{apiUrl}}/monsters HTTP/1.1
Content-Type: application/json
{
"name": "Monster 1",
"image_url": "https://robohash.org/1.png?set=set2&bgset=bg1&size=200x200",
"attack": 10,
"defense": 10,
"hp": 100,
"speed": 10
}
### Delete a monster by id
DELETE {{apiUrl}}/monsters/{{monsterId}} HTTP/1.1
### Update a monster by id
PUT {{apiUrl}}/monsters/{{monsterId}} HTTP/1.1
Content-Type: application/json
{
"name": "Monster 1",
"image_url": "https://robohash.org/1.png?set=set2&bgset=bg1&size=200x200",
"attack": 42,
"defense": 25,
"hp": 99,
"speed": 30
}
### Import monsters from a file (CSV)
POST {{apiUrl}}/monsters/import_monsters_csv HTTP/1.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="monsters-correct.csv"
Content-Type: text/csv
< ./src/utils/files/monsters-correct.csv
------WebKitFormBoundary7MA4YWxkTrZu0gW--
### Get all battles
GET {{apiUrl}}/battles HTTP/1.1
### Get a battle by id
GET {{apiUrl}}/battles/{{battleId}} HTTP/1.1
### Create a new battle
POST {{apiUrl}}/battles HTTP/1.1
Content-Type: application/json
{
"monster_a": "499b0ab4-249a-4e39-a356-89595b201216",
"monster_b": "111fbe1e-d65c-4f96-a15e-c65d71c56e60"
}
### Delete a battle by id
DELETE {{apiUrl}}/battles/{{battleId}} HTTP/1.1