댓글 검색 목록

[Nodejs] gh-got - GitHub API와 상호 작용할 수 있는 편리한 래퍼.

페이지 정보

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

https://github.com/sindresorhus/gh-got


const got = require('got');
const token = 'foo';

(async () => {
	const {body} = await got('https://api.github.com/users/sindresorhus', {
		json: true,
		headers: {
			'accept': 'application/vnd.github.v3+json',
			'authorization': `token ${token}`
		}
	});

	console.log(body.login);
	//=> 'sindresorhus'
})();

댓글목록 0

등록된 댓글이 없습니다.

웹학교 로고

온라인 코딩학교

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