forked from go-awesome/shortlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rest.http
48 lines (34 loc) · 1.08 KB
/
rest.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
### Index page
GET http://127.0.0.1:8080 HTTP/1.1
### Create Short URL request
POST http://127.0.0.1:8080/api/create HTTP/1.1
content-type: application/json
Authorization: "Bearer 1234567812345678123456781234567"
{
"url": "https://example.com"
}
### Update Short URL request
POST http://127.0.0.1:8080/api/update HTTP/1.1
content-type: application/json
Authorization: "Bearer 1234567812345678123456781234567"
{
"old": "https://example.com",
"new": "https://google.com",
"short": "N1|123ME1oJPK"
}
### Fetch all Short URL request
GET http://127.0.0.1:8080/api/fetch HTTP/1.1
content-type: application/json
Authorization: "Bearer 1234567812345678123456781234567"
### Fetch specific short URL traffic details
GET http://127.0.0.1:8080/api/fetch/N1|123ME1oJPK HTTP/1.1
content-type: application/json
Authorization: "Bearer 1234567812345678123456781234567"
### Delete the Short URL
POST http://127.0.0.1:8080/api/delete HTTP/1.1
content-type: application/json
Authorization: "Bearer 1234567812345678123456781234567"
{
"long": "https://google.com",
"short": "N1|123ME1oJPK"
}