-
Notifications
You must be signed in to change notification settings - Fork 2
/
apirequests.http
107 lines (79 loc) · 3.05 KB
/
apirequests.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# For a quick start check out our HTTP Requests collection (Tools|HTTP Client|Open HTTP Requests Collection).
#
# Following HTTP Request Live Templates are available:
# * 'gtrp' and 'gtr' create a GET request with or without query parameters;
# * 'ptr' and 'ptrp' create a POST request with a simple or parameter-like body;
# * 'mptr' and 'fptr' create a POST request to submit a form with a text or file field (multipart/form-data);
POST http://localhost:4000/auth/register
Content-Type: application/json
{
"username": "Sadric",
"password" : "P@ssw0rd"
}
###
POST http://localhost:4000/auth/login
Content-Type: application/json
{
"username": "Sadric",
"password" : "P@ssw0rd"
}
###
GET http://localhost:4000/api/category
Accept: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aW1lc3RhbXAiOjEyMzEyMywidXNlcm5hbWUiOiJDaHJpc3RpYW4ifQ.XspJECGRJfZT_oCoFgO2v7Di8r5acDpyGJjCDTdP-II
###
POST http://localhost:4000/api/category/create
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aW1lc3RhbXAiOjEyMzEyMywidXNlcm5hbWUiOiJDaHJpc3RpYW4ifQ.XspJECGRJfZT_oCoFgO2v7Di8r5acDpyGJjCDTdP-II
Content-Type: application/json
{
"category_name": "Fleisch"
}
###
PUT http://localhost:4000/api/category/2/edit
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aW1lc3RhbXAiOjEyMzEyMywidXNlcm5hbWUiOiJEYXZpZCJ9.2iypOTd_0zQqcGs1RS7N-6bbyRxoIQxx4rOcZjxtjPU
Content-Type: application/json
{
"category_name": "Schnaps"
}
###
DELETE http://localhost:4000/api/category/1/delete
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aW1lc3RhbXAiOjEyMzEyMywidXNlcm5hbWUiOiJEYXZpZCJ9.2iypOTd_0zQqcGs1RS7N-6bbyRxoIQxx4rOcZjxtjPU
Content-Type: application/json
###
###
GET http://localhost:4000/api/question
Accept: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aW1lc3RhbXAiOjEyMzEyMywidXNlcm5hbWUiOiJEb21pbmlrIn0.26rU3HOPbZiAPUeUXNxwhXlRMP9zAul3QEsViiZTpMg
###
POST http://localhost:4000/api/question/create
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aW1lc3RhbXAiOjEyMzEyMywidXNlcm5hbWUiOiJQZXRlciJ9.PAgcZc5VBiK3dI2m-UF6WmbC27yAHAuWug4JGFC0LDM
Content-Type: application/json
{
"question": "Wer hält den Weltrekord im 100m Sprint?",
"category_id": 2,
"answers": [
{
"answer": "Heinz Fischer",
"correct": false
},
{
"answer": "Alexander Van der Bellen",
"correct": true
},
{
"answer": "Norbert Hofer",
"correct": false
}
]
}
###
###
GET http://localhost:4000/api/question/category/1
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aW1lc3RhbXAiOjEyMzEyMywidXNlcm5hbWUiOiJQZXRlciJ9.PAgcZc5VBiK3dI2m-UF6WmbC27yAHAuWug4JGFC0LDM
Content-Type: application/json
###
GET http://localhost:4000/api/question/1/answer/3
Accept: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aW1lc3RhbXAiOjEyMzEyMywidXNlcm5hbWUiOiJQZXRlciJ9.PAgcZc5VBiK3dI2m-UF6WmbC27yAHAuWug4JGFC0LDM
Content-Type: application/json
###