Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const http = require('http');
- const request = http.get('some url', (response) => {
- let body = "";
- response.on('data', (chunk) => {
- body += chunk;
- });
- response.on('end', () => {
- if(response.statusCode === 200){
- try {
- console.log(body);
- } catch(e) {
- console.log('Error!');
- }
- }
- });
- });
Add Comment
Please, Sign In to add comment