-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.http
48 lines (38 loc) · 886 Bytes
/
routes.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
### GET a quiz
GET http://localhost:8080/quiz/1
### GET random quiz
GET http://localhost:8080/quiz/random
### Register
POST http://localhost:8080/register
content-type: application/json
{
"username": "Lucas",
"password": "batata"
}
### Create Quiz
# there is already a quiz with id 2 with this title
POST http://localhost:8080/quiz
Authorization: Basic THVjYXM6YmF0YXRh
content-type: application/json
{
"title": "Music Preference"
}
### Create question
# there is already this question with id = 2
POST http://localhost:8080/question
Authorization: Basic THVjYXM6YmF0YXRh
content-type: application/json
{
"question": "Music Preference",
"correct": "Rock",
"wrong": "Classic",
"quiz_id": 2
}
### Create answer
POST http://localhost:8080/answer/2
Authorization: Basic THVjYXM6YmF0YXRh
content-type: application/json
{
"answer_text": "Rock",
"question_id": 2
}