-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.js
More file actions
34 lines (27 loc) · 744 Bytes
/
test.js
File metadata and controls
34 lines (27 loc) · 744 Bytes
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
const http = require("http");
const axios = require("axios");
// const options = {
// hostname: 'www.google.com',
// port: 80,
// path: '/',
// method: 'GET',
// };
// const req = http.request(options, res => {
// // res.setEncoding('utf8');
// res.on('data', (chunk) => {
// });
// res.on('end', () => {
// console.log('No more data in response.');
// });
// res.on("close", () => {
// console.log("closing!");
// });
// });
// req.end()
const req = axios
.post(
"http://ec2-54-198-128-220.compute-1.amazonaws.com/log",
{ dsfdsfdsfdsfhjdsfhdsgvfhgdvsfghvdsfgvdshgfsdghvf: Buffer.alloc(1000 * 1000 * 3) },
)
.then(res => console.log("res", res.request));
console.log("request headers", req);