-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.http
154 lines (109 loc) · 3.62 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
@host = http://localhost:3001/api
@json = application/json
### Homepage
GET {{host}}/ HTTP/1.1
### Homepage Page 2
GET {{host}}/?page=2 HTTP/1.1
### User Register
POST {{host}}/register HTTP/1.1
content-type: {{json}}
{
"email": "q@qq.com",
"password": "123456",
"username": "q"
}
### User Login
# @name user_login
POST {{host}}/login HTTP/1.1
content-type: {{json}}
{
"email": "q@qq.com",
"password": "123456"
}
### User Info
# @name user_info
GET {{host}}/user/q HTTP/1.1
Authorization: Bearer {{user_login.response.body.$.token}}
### Users List
GET {{host}}/user/list HTTP/1.1
Authorization: Bearer {{user_login.response.body.$.token}}
### User Settings
GET {{host}}/settings HTTP/1.1
Authorization: Bearer {{user_login.response.body.$.token}}
### Update User Settings
POST {{host}}/settings/update HTTP/1.1
Authorization: Bearer {{user_login.response.body.$.token}}
content-type: {{json}}
{
"_id": "4859a909-35e9-4286-8d51-89f4d1d7973c",
"avatar": "/images/pnpm.svg",
"bio": "No pain, no gain.",
"birthday": "2016-03-14",
"email": "q@qq.com",
"gender": 1,
"job": "Student",
"nickname": "Q",
"password": null,
"phone": "14624351173",
"username": "q"
}
### My Topics
GET {{host}}/my-topics HTTP/1.1
Authorization: Bearer {{user_login.response.body.$.token}}
### My Favorites
GET {{host}}/my-favorites HTTP/1.1
Authorization: Bearer {{user_login.response.body.$.token}}
### Favor or Disfavor a Topic
POST {{host}}/favor HTTP/1.1
Authorization: Bearer {{user_login.response.body.$.token}}
content-type: {{json}}
{
"topic_id": "edb5c8d7-be7f-4242-923f-b4e4505a57bc"
}
### Topic Initiate
# @name topic_initiate
POST {{host}}/topic/initiate HTTP/1.1
Authorization: Bearer {{user_login.response.body.$.token}}
content-type: {{json}}
{
"content": "🎉️ 🎉️ 🎉️ See how the exact same Medium.com clone (called Conduit) is built using different frontends and backends. Yes, you can mix and match them, because they all adhere to the same API spec ❤️ ❤️ ❤️",
"tags": [],
"title": "Welcome to RealWorld project",
"user_id": "4859a909-35e9-4286-8d51-89f4d1d7973c"
}
### Topic Detail
GET {{host}}/topic/edb5c8d7-be7f-4242-923f-b4e4505a57bc HTTP/1.1
### Topic Update GET
GET {{host}}/topic/update/edb5c8d7-be7f-4242-923f-b4e4505a57bc HTTP/1.1
Authorization: Bearer {{user_login.response.body.$.token}}
### Topic Update POST
POST {{host}}/topic/update HTTP/1.1
Authorization: Bearer {{user_login.response.body.$.token}}
content-type: {{json}}
{
"_id": "edb5c8d7-be7f-4242-923f-b4e4505a57bc",
"content": "🎉️ 🎉️ 🎉️ See how the exact same Medium.com clone (called Conduit) is built using different frontends and backends. Yes, you can mix and match them, because they all adhere to the same API spec 🎉️ 🎉️ 🎉️ ",
"tags": ["Realworld", "API", "conduit"],
"tags_removed": ["react"],
"title": "Welcome to RealWorld project",
"user_id": "4859a909-35e9-4286-8d51-89f4d1d7973c"
}
### Topic Comment
POST {{host}}/topic/comment HTTP/1.1
Authorization: Bearer {{user_login.response.body.$.token}}
content-type: {{json}}
{
"content": "It's just a test comment.",
"topic": "edb5c8d7-be7f-4242-923f-b4e4505a57bc",
"user_id": "4859a909-35e9-4286-8d51-89f4d1d7973c"
}
### Profile, (User)Someone's Topics
GET {{host}}/profile/q HTTP/1.1
Authorization: Bearer {{user_login.response.body.$.token}}
### Profile, (User)Someone's Favorites
GET {{host}}/profile/q/favorites HTTP/1.1
Authorization: Bearer {{user_login.response.body.$.token}}
### Tag List
GET {{host}}/tags HTTP/1.1
### Tag Info
GET {{host}}/tags/conduit HTTP/1.1