anton-yarchuk
3/8/2019 - 9:04 PM

Got - friendly HTTP request library

const got = require('got'); 

(async () => {
  try {
    const response = await got('sindresorhus.com');
    console.log(response.body);
    //=> '<!doctype html> ...'    
  } catch (error) {        
    console.log(error.response.body);        
    //=> 'Internal server error ...'    
  }})();