반응형 node.js2 Node.js HTTP Request 보내기 (with request.js) 1. HTTP GET 요청 1) 단순 GET 요청 (1) Code const request = require('request'); // Get 요청하기 http://www.google.com const options = { uri: "http://www.google.com" }; request.get(options, function (error, response, body) { //callback }); (2) Payload 2) Query String을 포함한 GET 요청 (1) Code const request = require('request'); // Get 요청하기 http://www.google.com?id=1000 const options = { uri: "http://www.google.c.. 2019. 7. 16. Linux에 nodejs 설치하기 Linux에 nodejs 설치하기 Nodejs는 기존에 웹브라우저에서 주로 사용되던 Client-Side Script언어인 Javascript를 Server-Side에서 사용 가능하도록 Chrome의 V8 Javascript 엔진으로 빌드된 런타임입니다. 이 글은 Linux 환경에서 Binary 형태로 제공된 Nodejs 설치 법을 간단히 정리하였습니다. 1) nodejs 다운로드 (https://nodejs.org/en/download/) # cd /opt/# mkdir nodejs# wget https://nodejs.org/dist/v10.14.1/node-v10.14.1-linux-x64.tar.xz 2) 압축해제# xz -d node-v10.14.1-linux-x64.tar.xz# tar xf .. 2018. 12. 5. 이전 1 다음 반응형