댓글 검색 목록

[Nodejs] got - 내장 된 HTTP 모듈에 좋은 인터페이스.

페이지 정보

작성자 운영자 작성일 19-03-07 11:27 조회 403 댓글 0

https://github.com/sindresorhus/got

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 ...'
	}
})();


댓글목록 0

등록된 댓글이 없습니다.

웹학교 로고

온라인 코딩학교

코리아뉴스 2001 - , All right reserved.