@@ -2711,6 +2711,28 @@ Type: Documentation-only.
2711
2711
2712
2712
Prefer [ ` message.socket ` ] [ ] over [ ` message.connection ` ] [ ] .
2713
2713
2714
+ ### DEP0XXX: ` .aborted ` property and ` 'abort' ` , ` 'aborted' ` event in ` http `
2715
+ <!-- YAML
2716
+ changes:
2717
+ - version: REPLACEME
2718
+ pr-url: https://github.com/nodejs/node/pull/36670
2719
+ description: Documentation-only deprecation.
2720
+ -->
2721
+
2722
+ Type: Documentation-only
2723
+
2724
+ Move to {Stream} API instead, as the [ ` http.ClientRequest ` ] [ ] ,
2725
+ [ ` http.ServerResponse ` ] [ ] , and [ ` http.IncomingMessage ` ] [ ] are all stream-based.
2726
+ Check ` stream.destroyed ` instead of the ` .aborted ` property, and listen for
2727
+ ` 'close' ` instead of ` 'abort' ` , ` 'aborted' ` event.
2728
+
2729
+ The ` .aborted ` property and ` 'abort' ` event are only useful for detecting
2730
+ ` .abort() ` calls. For closing a request early, use the Stream
2731
+ ` .destroy([error]) ` then check the ` .destroyed ` property and ` 'close' ` event
2732
+ should have the same effect. The receiving end should also check the
2733
+ [ ` readable.readableEnded ` ] [ ] value on [ ` http.IncomingMessage ` ] [ ] to get whether
2734
+ it was an aborted or graceful destroy.
2735
+
2714
2736
[ Legacy URL API ] : url.md#url_legacy_url_api
2715
2737
[ NIST SP 800-38D ] : https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
2716
2738
[ RFC 6066 ] : https://tools.ietf.org/html/rfc6066#section-3
@@ -2765,6 +2787,9 @@ Prefer [`message.socket`][] over [`message.connection`][].
2765
2787
[ `fs.read()` ] : fs.md#fs_fs_read_fd_buffer_offset_length_position_callback
2766
2788
[ `fs.readSync()` ] : fs.md#fs_fs_readsync_fd_buffer_offset_length_position
2767
2789
[ `fs.stat()` ] : fs.md#fs_fs_stat_path_options_callback
2790
+ [ `http.ClientRequest` ] : #http_class_http_clientrequest
2791
+ [ `http.IncomingMessage` ] : #http_class_http_incomingmessage
2792
+ [ `http.ServerResponse` ] : #http_class_http_serverresponse
2768
2793
[ `http.get()` ] : http.md#http_http_get_options_callback
2769
2794
[ `http.request()` ] : http.md#http_http_request_options_callback
2770
2795
[ `https.get()` ] : https.md#https_https_get_options_callback
@@ -2777,6 +2802,7 @@ Prefer [`message.socket`][] over [`message.connection`][].
2777
2802
[ `process.env` ] : process.md#process_process_env
2778
2803
[ `process.mainModule` ] : process.md#process_process_mainmodule
2779
2804
[ `punycode` ] : punycode.md
2805
+ [ `readable.readableEnded` ] : stream.md#stream_readable_readableended
2780
2806
[ `request.abort()` ] : http.md#http_request_abort
2781
2807
[ `request.connection` ] : http.md#http_request_connection
2782
2808
[ `request.destroy()` ] : http.md#http_request_destroy_error
0 commit comments