-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.http
74 lines (47 loc) · 1.38 KB
/
test.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
# API request test, like a `Postman`.
# First, the `REST Client` extension (VS Code) needs to be installed.
# And then, just click `Send Request` above each request rule,
# you'll see what happened, have fun!
@host = http://localhost:3000/api
@json = application/json
### User Login
# @name user_login
POST {{host}}/login HTTP/1.1
content-type: {{json}}
{
"email": "yoonge@qq.com",
"password": "123456"
}
### User Register
POST {{host}}/register HTTP/1.1
content-type: {{json}}
{
"email": "q@qq.com",
"password": "123456",
"username": "q"
}
### Homepage, Topic List
GET {{host}}/ HTTP/1.1
### Topic List with Pagination
GET {{host}}/?page=2 HTTP/1.1
### Topic Detail
GET {{host}}/topic/66056df1fbf8c8a575717dc1 HTTP/1.1
### All Tags
GET {{host}}/tags HTTP/1.1
### Single Tag (e.g., react)
GET {{host}}/tags/react HTTP/1.1
### User Profile, Own Topics
GET {{host}}/profile/one HTTP/1.1
Authorization: {{user_login.response.body.$.token}}
### User Profile, Favorites
GET {{host}}/profile/one/favorites HTTP/1.1
Authorization: {{user_login.response.body.$.token}}
### My Settings
GET {{host}}/settings HTTP/1.1
Authorization: {{user_login.response.body.$.token}}
### My Topics
GET {{host}}/my-topics HTTP/1.1
Authorization: {{user_login.response.body.$.token}}
### My Favorites
GET {{host}}/my-favorites HTTP/1.1
Authorization: {{user_login.response.body.$.token}}