📜  npm got - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:17.389000             🧑  作者: Mango

代码示例1
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 ...'
    }
})();