forked from gftf2011/url-shortener
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.http
50 lines (36 loc) · 841 Bytes
/
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
@url = http://localhost:3000
# @name createAccount
POST {{url}}/clients/create-account
content-type: application/json
{
"email": "[email protected]",
"password": "12345678bB#",
"fullName": "Gabriel Ferrari Tarallo Ferraz"
}
###
# @name loginToAccount
POST {{url}}/clients/login
content-type: application/json
{
"email": "[email protected]",
"password": "12345678bB#"
}
###
@accessToken = {{loginToAccount.response.body.accessToken}}
# @name createShortUrl
POST {{url}}
Content-Type: application/json
Authorization: {{accessToken}}
{
"longUrl": "https://www.google.com"
}
###
@shortLink = {{createShortUrl.response.body.id}}
# @name redirect
GET {{url}}/{{shortLink}}
Content-Type: application/json
###
# @name deleteUrl
DELETE {{url}}/{{shortLink}}
Content-Type: application/json
Authorization: {{accessToken}}