본문 바로가기
  • [성공하는 개발자] - Developer
Node

[Node] 글생성/수정/삭제

by Sein-JH 2021. 5. 2.
728x90

POST 데이터 받기

var body = '';

        request.on('data', function (data) {
            body += data;

            // Too much POST data, kill the connection!
            // 1e6 === 1 * Math.pow(10, 6) === 1 * 1000000 ~~~ 1MB
            if (body.length > 1e6)
                request.connection.destroy();
        });

        request.on('end', function () {
            var post = qs.parse(body);
            // use post['blah'], etc.
        });

'Node' 카테고리의 다른 글

[Node] App 모듈 형식  (0) 2021.05.02
[Node] JavaScript 객체  (0) 2021.05.02
[Node] Form - Method  (0) 2021.04.29
[Node] NPM PM2  (0) 2021.04.29
[Node] 함수(funcion)  (0) 2021.04.27

댓글