패키지 URL : https://www.npmjs.com/package/request
다른 서버에 http 요청을 하고싶을 때 유용한 모듈.
사용 방법이 간편함
예제
const request = require('request');
request('http://www.google.com', (error, response, body) => {
console.log('error:', error); // Print the error if one occurred
console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
console.log('body:', body); // Print the HTML for the Google homepage.
});
'프로그래밍 > Node.js | ES6' 카테고리의 다른 글
[Javascript] 객체 분해와 동시에 이름 짓기 (0) | 2020.02.23 |
---|---|
[Typescript] Interface의 propsName 형식 지정 (0) | 2019.12.28 |
[Package] 정해진 시간에 반복할 때 유용한 node-schedule (0) | 2019.08.19 |
[Mysql] 여러 라인 한꺼번에 삽입 (0) | 2019.07.16 |
[Babel] 상대경로를 절대경로로 import(root, alias 설정) (0) | 2019.07.16 |
댓글