File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -1421,6 +1421,34 @@ added: v8.13.0
1421
1421
The ` message.aborted ` property will be ` true ` if the request has
1422
1422
been aborted.
1423
1423
1424
+ ### message.complete
1425
+ <!-- YAML
1426
+ added: v0.3.0
1427
+ -->
1428
+
1429
+ * {boolean}
1430
+
1431
+ The ` message.complete ` property will be ` true ` if a complete HTTP message has
1432
+ been received and successfully parsed.
1433
+
1434
+ This property is particularly useful as a means of determining if a client or
1435
+ server fully transmitted a message before a connection was terminated:
1436
+
1437
+ ``` js
1438
+ const req = http .request ({
1439
+ host: ' 127.0.0.1' ,
1440
+ port: 8080 ,
1441
+ method: ' POST'
1442
+ }, (res ) => {
1443
+ res .resume ();
1444
+ res .on (' end' , () => {
1445
+ if (! res .complete )
1446
+ console .error (
1447
+ ' The connection was terminated while the message was still being sent' );
1448
+ });
1449
+ });
1450
+ ```
1451
+
1424
1452
### message.destroy([ error] )
1425
1453
<!-- YAML
1426
1454
added: v0.3.0
You can’t perform that action at this time.
0 commit comments