nodejs 에서 api 호출 채택완료
선구자
7년 전
조회 2,940
리눅스 shell에서
npm install node-fetch한다음
js 에서 아래처럼 하면 되는거 아닌가요?
const fetch = require('node-fetch');
var sendData = {json}
fetch('https://주소/api/apiName', { method: 'POST', body: sendData }) .then(res => res.json()) .then(json => console.log(json));
오류는 node-fetch를 찾을수 없다고 나오네요..
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인