Answers for "npm got"

0

npm got

const got = require('got');

(async () => {
	try {
		const response = await got('https://sindresorhus.com');
		console.log(response.body);
		//=> '<!doctype html> ...'
	} catch (error) {
		console.log(error.response.body);
		//=> 'Internal server error ...'
	}
})();
Posted by: Guest on June-22-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language