-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.http
56 lines (43 loc) · 1.04 KB
/
api.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
### REST Client for Visual Studio Code "ext install humao.rest-client" ###
###@baseUrl = http://localhost:3333
@baseUrl = https://api-solid-p4o1.onrender.com/
### Create user
POST {{baseUrl}}/users
Content-Type: application/json
{
"name":"Bruno S. Duarte",
"email": "[email protected]",
"password": "123456"
}
### Authenticate
# @name authenticated
POST {{baseUrl}}/sessions
Content-Type: application/json
{
"email": "[email protected]",
"password": "123456"
}
### you need authenticate to obtain token
@token = {{authenticated.response.body.token}}
### Profile
GET {{baseUrl}}/me HTTP/1.1
Authorization: Bearer {{token}}
### Refresh token
PATCH {{baseUrl}}/token/refresh
Content-Type: application/json
Authorization: Bearer {{token}}
{
"email": "[email protected]",
"password": "123456"
}
### Create gym
POST {{baseUrl}}/gyms
Authorization: Bearer {{token}}
Content-Type: application/json
{
"title": "TypeScript Gym",
"description": "Some description.",
"phone": "1199999999",
"latitude": -27.2092052,
"longitude": -49.6401091,
}