📅  最后修改于: 2022-03-11 15:03:17.389000             🧑  作者: Mango
const got = require('got');
(async () => {
try {
const response = await got('https://sindresorhus.com');
console.log(response.body);
//=> ' ...'
} catch (error) {
console.log(error.response.body);
//=> 'Internal server error ...'
}
})();