Hello
This commit is contained in:
21
http/request-get.js
Normal file
21
http/request-get.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const https = require("https");
|
||||
const options = {
|
||||
hostname: "www.naver.com",
|
||||
port: 443,
|
||||
path: "/",
|
||||
method: "GET",
|
||||
};
|
||||
|
||||
const req = https.request(options, (res) => {
|
||||
console.log(`statusCode: ${res.statusCode}`);
|
||||
|
||||
res.on("data", (d) => {
|
||||
process.stdout.write(d);
|
||||
});
|
||||
});
|
||||
|
||||
req.on("error", (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
req.end();
|
||||
Reference in New Issue
Block a user