@@ -568,6 +568,7 @@ server.listen(1337, '127.0.0.1', () => {
568
568
### ` request.abort() `
569
569
<!-- YAML
570
570
added: v0.3.8
571
+ deprecated: REPLACEME
571
572
-->
572
573
573
574
Marks the request as aborting. Calling this will cause remaining data
@@ -2356,8 +2357,44 @@ the following events will be emitted in the following order:
2356
2357
* ` 'close' `
2357
2358
* ` 'close' ` on the ` res ` object
2358
2359
2359
- If ` req.abort() ` is called before the connection succeeds, the following events
2360
- will be emitted in the following order:
2360
+
2361
+ If ` req.destroy() ` is called before a socket is assigned, the following
2362
+ events will be emitted in the following order:
2363
+
2364
+ * (` req.destroy() ` called here)
2365
+ * ` 'error' ` with an error with message ` 'Error: socket hang up' ` and code
2366
+ ` 'ECONNRESET' `
2367
+ * ` 'close' `
2368
+
2369
+ If ` req.destroy() ` is called before the connection succeeds, the following
2370
+ events will be emitted in the following order:
2371
+
2372
+ * ` 'socket' `
2373
+ * (` req.destroy() ` called here)
2374
+ * ` 'error' ` with an error with message ` 'Error: socket hang up' ` and code
2375
+ ` 'ECONNRESET' `
2376
+ * ` 'close' `
2377
+
2378
+ If ` req.destroy() ` is called after the response is received, the following
2379
+ events will be emitted in the following order:
2380
+
2381
+ * ` 'socket' `
2382
+ * ` 'response' `
2383
+ * ` 'data' ` any number of times, on the ` res ` object
2384
+ * (` req.destroy() ` called here)
2385
+ * ` 'aborted' ` on the ` res ` object
2386
+ * ` 'close' `
2387
+ * ` 'close' ` on the ` res ` object
2388
+
2389
+ If ` req.abort() ` is called before a socket is assigned, the following
2390
+ events will be emitted in the following order:
2391
+
2392
+ * (` req.abort() ` called here)
2393
+ * ` 'abort' `
2394
+ * ` 'close' `
2395
+
2396
+ If ` req.abort() ` is called before the connection succeeds, the following
2397
+ events will be emitted in the following order:
2361
2398
2362
2399
* ` 'socket' `
2363
2400
* (` req.abort() ` called here)
@@ -2366,8 +2403,8 @@ will be emitted in the following order:
2366
2403
` 'ECONNRESET' `
2367
2404
* ` 'close' `
2368
2405
2369
- If ` req.abort() ` is called after the response is received, the following events
2370
- will be emitted in the following order:
2406
+ If ` req.abort() ` is called after the response is received, the following
2407
+ events will be emitted in the following order:
2371
2408
2372
2409
* ` 'socket' `
2373
2410
* ` 'response' `
0 commit comments