Request.setManualFramingHeaders()
The setManualFramingHeaders()
method of the Request
interface controls how the framing headers should be determined.
By default the framing headers are set to "automatic" mode, which means they are created based on the body of the associated Request instance.
In "automatic" mode, a Content-Length
is used when the size of the body can be determined before it is sent.
Requests sent in streaming mode, where headers are sent immediately but the content of the body is streamed later, will receive a Transfer-Encoding: chunked
to accommodate the dynamic generation of the body.
In "manual" mode, any Content-Length
or Transfer-Encoding
headers will be honored.
You must ensure that those headers have correct values permitted by the HTTP/1.1 specification.
If the provided headers are not permitted by the specification, the headers will revert to "automatic" mode and a diagnostic message will be logged about what was wrong.
If a Content-Length
is permitted by the specification, but the value does not match the size of the actual body, the body will either be truncated (if it is too long), or the connection will be hung up early (if it is too short).
Syntax
Syntax
setManualFramingHeaders(manual)
Parameters
manual
: boolean- : Whether or not to use "manual" mode for the framing headers.
Return value
undefined
.