@@ -3773,7 +3773,7 @@ Removes a header that has been queued for implicit sending. |
3773 | 3773 | response.removeHeader('Content-Encoding'); |
3774 | 3774 | ``` |
3775 | 3775 |
|
3776 | | -### `response.req` |
| 3776 | +#### `response.req` |
3777 | 3777 |
|
3778 | 3778 | <!-- YAML |
3779 | 3779 | added: v15.7.0 |
@@ -3991,30 +3991,34 @@ Sends a status `100 Continue` to the client, indicating that the request body |
3991 | 3991 | should be sent. See the [`'checkContinue'`][] event on `Http2Server` and |
3992 | 3992 | `Http2SecureServer`. |
3993 | 3993 |
|
3994 | | -### `response.writeEarlyHints(links)` |
| 3994 | +#### `response.writeEarlyHints(hints)` |
3995 | 3995 |
|
3996 | 3996 | <!-- YAML |
3997 | 3997 | added: v18.11.0 |
3998 | 3998 | --> |
3999 | 3999 |
|
4000 | | -* `links` {string|Array} |
| 4000 | +* `hints` {Object} |
4001 | 4001 |
|
4002 | 4002 | Sends a status `103 Early Hints` to the client with a Link header, |
4003 | 4003 | indicating that the user agent can preload/preconnect the linked resources. |
4004 | | -The `links` can be a string or an array of strings containing the values |
4005 | | -of the `Link` header. |
| 4004 | +The `hints` is an object containing the values of headers to be sent with |
| 4005 | +early hints message. |
4006 | 4006 |
|
4007 | 4007 | **Example** |
4008 | 4008 |
|
4009 | 4009 | ```js |
4010 | 4010 | const earlyHintsLink = '</styles.css>; rel=preload; as=style'; |
4011 | | -response.writeEarlyHints(earlyHintsLink); |
| 4011 | +response.writeEarlyHints({ |
| 4012 | + 'link': earlyHintsLink, |
| 4013 | +}); |
4012 | 4014 |
|
4013 | 4015 | const earlyHintsLinks = [ |
4014 | 4016 | '</styles.css>; rel=preload; as=style', |
4015 | 4017 | '</scripts.js>; rel=preload; as=script', |
4016 | 4018 | ]; |
4017 | | -response.writeEarlyHints(earlyHintsLinks); |
| 4019 | +response.writeEarlyHints({ |
| 4020 | + 'link': earlyHintsLinks, |
| 4021 | +}); |
4018 | 4022 | ``` |
4019 | 4023 |
|
4020 | 4024 | #### `response.writeHead(statusCode[, statusMessage][, headers])` |
|