-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.http
More file actions
40 lines (34 loc) · 790 Bytes
/
client.http
File metadata and controls
40 lines (34 loc) · 790 Bytes
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
@host = localhost
@port = 3333
@baseUrl = http://localhost:3333
@authToken = {{authenticate.response.body.access_token}}
# @name create_account
POST {{baseUrl}}/accounts HTTP/1.1
Content-Type: application/json
{
"name": "Carlos",
"email": "carlos10@test.com",
"password": "123456"
}
###
# @name authenticate
POST {{baseUrl}}/sessions HTTP/1.1
Content-Type: application/json
{
"email": "carlos@test.com",
"password": "123456"
}
###
# @name create_question
POST {{baseUrl}}/questions HTTP/1.1
Content-Type: application/json
Authorization: Bearer {{authToken}}
{
"title": "Nova pergunta 6",
"content": "Conteúdo da pergunta 2"
}
###
# @name fetch_recent_questions
GET {{baseUrl}}/questions?page=1 HTTP/1.1
Content-Type: application/json
Authorization: Bearer {{authToken}}