回答編集履歴
1
追記
answer
CHANGED
@@ -12,4 +12,12 @@
|
|
12
12
|
data += chunk ;
|
13
13
|
console.log("post受信")
|
14
14
|
});
|
15
|
-
|
15
|
+
// 追記部分
|
16
|
+
req.on('end',function(){
|
17
|
+
console.log("受信完了"); // data を処理して res の処理を書く
|
18
|
+
});
|
19
|
+
```
|
20
|
+
|
21
|
+
req は [http.IncomingMessage](https://nodejs.org/api/http.html#http_class_http_incomingmessage) < [ReadableStream](https://nodejs.org/api/stream.html#stream_readable_streams) のような実装のはずですので、イベントなどをご確認ください。
|
22
|
+
|
23
|
+
また、[npm formidable](https://www.npmjs.com/package/formidable) のような、受信データを処理するモジュールもあります(express.bodyParserなどで利用されているモジュール)。
|