Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/HTTP/JavaScript/http-5.js
Normal file
19
Task/HTTP/JavaScript/http-5.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
const http = require('http');
|
||||
|
||||
http.get('http://rosettacode.org', (resp) => {
|
||||
|
||||
let data = '';
|
||||
|
||||
// A chunk of data has been recieved.
|
||||
resp.on('data', (chunk) => {
|
||||
data += chunk;
|
||||
});
|
||||
|
||||
// The whole response has been received. Print out the result.
|
||||
resp.on('end', () => {
|
||||
console.log("Data:", data);
|
||||
});
|
||||
|
||||
}).on("error", (err) => {
|
||||
console.log("Error: " + err.message);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue