-
Notifications
You must be signed in to change notification settings - Fork 0
/
requests.http
321 lines (271 loc) · 6.92 KB
/
requests.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
### all post json has NO TRAILING "," !!!
### https://github.com/Huachao/vscode-restclient
### Test remote
GET 142.93.217.249:3000/ic/test
### root
GET http://localhost:3000
### hello
GET http://localhost:3000/hello
### get all books
GET http://localhost:3000/books/
### get_user_by_id
GET http://localhost:3000/user/100
### exactmatch
GET http://localhost:3000/user/092
### query_params
GET http://localhost:3000/query_params?code=hello world&user_id=155
### query_headers: after the request line to first empty line
GET http://localhost:3000/query_headers
User-Agent: rest-client
Accept: */*
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6,zh-CN;q=0.4
Content-Type: application/json
### query_custom_headers
GET http://localhost:3000/query_custom_headers
User-Agent: rest-client
Accept: */*
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6,zh-CN;q=0.4
Content-Type: application/json
alg: HS256
typ: JWT
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzU3NjU0NjIsImlhdCI6MTY3NTc2NTQzMn0.D-kvS-O9wTYMYeYjc4FugbHOFEIrKtiUH7JJSNEoI8U
### get_appstate
GET http://localhost:3000/get_appstate
### get_appstate_mode
GET http://localhost:3000/get_appstate_mode
### get_custom_middleware
GET http://localhost:3000/get_custom_middleware
User-Agent: rest-client
Accept: */*
security-level: "abc security 9"
### always_errors
GET http://localhost:3000/always_errors
### get_body_string
POST http://localhost:3000/get_body_string
content-type: application/json
{
"get_body_string hello"
}
### validate_struct_input
POST http://localhost:3000/validate_struct_input
content-type: application/json
{
"username": "John Doe",
"password": "12345678",
"email": "[email protected]"
}
### validate_struct_input: fail in password length and email format
POST http://localhost:3000/validate_struct_input
content-type: application/json
{
"username": "John Doe",
"password": "1234567",
"email": "abc"
}
### add_user
POST http://localhost:3000/users
content-type: application/json
{
"username": "John Doe5",
"password": "12345678",
"email": "[email protected]"
}
### add_user: fail in password length and email format
POST http://localhost:3000/users
content-type: application/json
{
"username": "John Doe3",
"password": "1234567",
"email": "abc"
}
### login
POST http://localhost:3000/users/login
content-type: application/json
{
"username": "John Doe5",
"password": "12345678"
}
### login should fail
POST http://localhost:3000/users/login
content-type: application/json
{
"username": "John Doe5",
"password": "1234567"
}
### login should succeed
POST http://localhost:3000/users/login
content-type: application/json
{
"username": "John Doe5",
"password": "12345678"
}
### JWT https://github.com/Huachao/vscode-restclient
GET http://localhost:3000/hello
User-Agent: rest-client
Accept: */*
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6,zh-CN;q=0.4
Content-Type: application/json
alg: HS256
typ: JWT
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzU4NTYwMjQsImlhdCI6MTY3NTg1NTk5NH0.F2jJtWJ0wd6XYH7dHfERLzEo9mHvoqidokucdsWfI5w
### logout
POST http://localhost:3000/users/logout
User-Agent: rest-client
Accept: */*
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6,zh-CN;q=0.4
Content-Type: application/json
alg: HS256
typ: JWT
Authorization: Bearer 1234567890
### get_task_by_id
GET http://localhost:3000/tasks/5
### get_task_by_id
GET http://localhost:3000/tasks/999
### get_task_all
GET http://localhost:3000/tasks
### get_task_all + priority
GET http://localhost:3000/tasks?priority=A
### get_task_all + priority
GET http://localhost:3000/tasks?priority=B
### get_task_all + priority
GET http://localhost:3000/tasks?priority=
### get_task_all + priority
GET http://localhost:3000/tasks?priority=D
### get_task_all + priority
GET http://localhost:3000/tasks?title=title1
### get_task_all + priority
GET http://localhost:3000/tasks?priority=A&title=title1
### add_task
POST http://localhost:3000/add_task
content-type: application/json
{
"title": "title2",
"priority": "C",
"description": "description C"
}
### get_task_all
GET http://localhost:3000/tasks
### replace_task
PUT http://localhost:3000/tasks/5
content-type: application/json
{
"task_id": 999,
"title": "title2",
"priority": "AB"
}
### get_task_by_id
GET http://localhost:3000/tasks/9
### update_partial_task: no descrition at all
PATCH http://localhost:3000/tasks/5
content-type: application/json
{
"task_id": 999,
"title": "title 22",
"priority": "ABC"
}
### update_partial_task
PATCH http://localhost:3000/tasks/5
content-type: application/json
{
"task_id": 999,
"title": "title 22",
"priority": "AB",
"description": "some description"
}
### update_partial_task: description has null value
PATCH http://localhost:3000/tasks/5
content-type: application/json
{
"task_id": 999,
"title": "title 22",
"priority": "AB",
"description": null
}
### get_task_by_id
GET http://localhost:3000/tasks/5
### get_task_all
GET http://localhost:3000/tasks
### get_task_all
GET http://localhost:3000/tasks
User-Agent: rest-client
Accept: */*
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6,zh-CN;q=0.4
Content-Type: application/json
alg: HS256
typ: JWT
Authorization: Bearer vwig.3435u2ng.lv6iria
### hard delete
DELETE http://localhost:3000/tasks/5
### soft delete
DELETE http://localhost:3000/tasks/6?is_soft=true
### get_task_by_id
GET http://localhost:3000/tasks/6
### eth_local_txn
POST http://localhost:3000/eth_local_txn
content-type: application/json
{
"to_address": "0x1234abcd"
}
### eth_deploy_contract
POST http://localhost:3000/eth_deploy_contract
content-type: application/json
{
"to_address": "0x1234abcd"
}
### eth_live_read
POST http://localhost:3000/eth_live_read
content-type: application/json
{
"addr1": "0xabcdef1",
"addr2": "0xabcdef2"
}
### eth_live_write
POST http://localhost:3000/eth_live_write
content-type: application/json
{
"num1": 3.5,
"addr1": "0xabcdef1",
"addr2": "0xabcdef2"
}
### eth_send_ether
POST http://localhost:3000/eth_send_ether
content-type: application/json
{
"num1": 0.0001,
"addr1": "0xabcdef1",
"addr2": "0xabcdef2"
}
### run_thread
POST http://localhost:3000/run_thread
content-type: application/json
{
"to_address": "0x1234abcd"
}
### make_get_request
GET http://localhost:3000/make_get_request
### make_post_request
POST http://localhost:3000/make_post_request
content-type: application/json
{
"to_address": "0x1234abcd"
}
### download_file
POST http://localhost:3000/download_file
content-type: application/json
{
"to_address": "0x1234abcd"
}
### chainlink_prices
GET http://localhost:3000/chainlink_prices
### xrd_price_coinmarketcap
GET http://localhost:3000/xrd_price_coinmarketcap
### xrd_price_coinmarketcap
GET https://pro-api.coinmarketcap.com/v2/cryptocurrency/market-pairs/latest?symbol={xrd}
User-Agent: rest-client
Accept: */*
Content-Type: application/json
X-CMC_PRO_API_KEY: 418e2ca9-b35e-4545-b759-6d6baf2e8d44
### make_keypair2
GET http://localhost:3000/make_keypair2
### Get Google
GET www.google.com