-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.http
158 lines (116 loc) · 3.05 KB
/
client.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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
@baseUrl = http://localhost:3333
@authToken = {{authenticate.response.body.accessToken}}
# @name create_account
POST {{baseUrl}}/accounts
Content-Type: application/json
{
"name": "Luis Fernando",
"email": "[email protected]",
"password": "123456"
}
###
# @name authenticate
POST {{baseUrl}}/sessions
Content-Type: application/json
{
"email": "[email protected]",
"password": "123456"
}
###
# @name create_question
POST {{baseUrl}}/questions
Content-Type: application/json
Authorization: Bearer {{authToken}}
{
"title": "Pergunta",
"content": "Teste"
}
###
# @name fetch_recent_question
GET {{baseUrl}}/questions?page=1
Content-Type: application/json
Authorization: Bearer {{authToken}}
###
# @name get_question_by_slug
GET {{baseUrl}}/questions/pergunta
Content-Type: application/json
Authorization: Bearer {{authToken}}
###
# @name edit_question
PUT {{baseUrl}}/questions/337a397f-aa5a-4dc3-93c8-0750dcc7b30f
Content-Type: application/json
Authorization: Bearer {{authToken}}
{
"title": "Pergunta editada",
"content": "Teste editada"
}
###
# @name delete_question
DELETE {{baseUrl}}/questions/f199abf2-ef98-4d85-8f1a-3a2af51c8336
Content-Type: application/json
Authorization: Bearer {{authToken}}
###
# @name answer_question
POST {{baseUrl}}/questions/2644776a-bbae-4a83-96a5-9cf5083180b3/answers
Content-Type: application/json
Authorization: Bearer {{authToken}}
{
"content": "Resposta Teste"
}
###
# @name choose_question_best_answer
PATCH {{baseUrl}}/answers/28384309-c71b-477c-af83-03c6bd65b9b0/choose-as-best
Content-Type: application/json
Authorization: Bearer {{authToken}}
###
# @name edit_answer
PUT {{baseUrl}}/answers/28384309-c71b-477c-af83-03c6bd65b9b0
Content-Type: application/json
Authorization: Bearer {{authToken}}
{
"content": "Resposta Editada"
}
###
# @name delete_answer
DELETE {{baseUrl}}/answers/28384309-c71b-477c-af83-03c6bd65b9b0
Content-Type: application/json
Authorization: Bearer {{authToken}}
###
# @name comment_on_question
POST {{baseUrl}}/questions/2644776a-bbae-4a83-96a5-9cf5083180b3/comments
Content-Type: application/json
Authorization: Bearer {{authToken}}
{
"content": "comentario teste"
}
###
# @name fetch_question_comments
GET {{baseUrl}}/questions/2644776a-bbae-4a83-96a5-9cf5083180b3/comments
Content-Type: application/json
Authorization: Bearer {{authToken}}
###
# @name delete_question_comment
DELETE {{baseUrl}}/questions/comments/cc91a21e-d606-41c2-9ab4-16c73772a2c6
Content-Type: application/json
Authorization: Bearer {{authToken}}
###
# @name comment_on_answer
POST {{baseUrl}}/answers/fc6712bc-6261-4c78-88fe-2ceb7d70e818/comments
Content-Type: application/json
Authorization: Bearer {{authToken}}
{
"content": "comentario teste"
}
###
# @name fetch_answer_comments
GET {{baseUrl}}/answers/fc6712bc-6261-4c78-88fe-2ceb7d70e818/comments
Content-Type: application/json
Authorization: Bearer {{authToken}}
{
"content": "comentario teste"
}
###
# @name delete_answer_comment
DELETE {{baseUrl}}/answers/comments/b52688b3-3821-4fb3-aaa3-36c79aecc085
Content-Type: application/json
Authorization: Bearer {{authToken}}