回答編集履歴

1

追記

2020/03/14 11:51

投稿

AkitoshiManabe
AkitoshiManabe

スコア5434

test CHANGED
@@ -26,4 +26,20 @@
26
26
 
27
27
  });
28
28
 
29
+ // 追記部分
30
+
31
+ req.on('end',function(){
32
+
33
+ console.log("受信完了"); // data を処理して res の処理を書く
34
+
35
+ });
36
+
29
37
  ```
38
+
39
+
40
+
41
+ req は [http.IncomingMessage](https://nodejs.org/api/http.html#http_class_http_incomingmessage) < [ReadableStream](https://nodejs.org/api/stream.html#stream_readable_streams) のような実装のはずですので、イベントなどをご確認ください。
42
+
43
+
44
+
45
+ また、[npm formidable](https://www.npmjs.com/package/formidable) のような、受信データを処理するモジュールもあります(express.bodyParserなどで利用されているモジュール)。