Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Static
- effective
- nodejs
- NoSQL
- reactor
- r
- Linux
- 네트워크
- VCS
- cache
- javascript
- mongodb
- Elk
- git
- socket
- AWS
- reactive
- 데이터통신
- Java
- redis
- spring
- network
- HTTP
- html
- Heap
- github
- mybatis
- ajax
- libuv
- Lombok
Archives
- Today
- Total
목록body-parser (1)
빨간색코딩
body-parser 모듈 (urlencoded, extended 옵션)
참조문서 : https://www.npmjs.com/package/body-parserpost로 요청된 body를 쉽게 추출할 수 있는 모듈이다. 추출된 결과는 request객체(IncomingMessage 타입)에 body 속성으로 저장된다. API문서보면 다양한 메소드들이 많지만, 여기서는 URL-encoded form body parser만 사용한다.npm install body-parser 로 설치한다.1. http 내장모듈만 쓰는 것과 뭐가 틀린가?http모듈로만 post body를 파싱하려면, req.on('data', function(chunk) { body += chunk; }); 와 같이 이벤트를 등록해야한다. 그다음에 인코딩처리를 해줘야한다.그치만 body-parser를 쓰면 bodyP..
node.js
2018. 6. 26. 13:50