Represents any value that can be treated as a body payload in HTTP response handling.
This type is a union of various formats that a body can take, enabling flexibility in providing content.
Response
string
Buffer
Uint8Array
Readable
ReadableStream
null
String bodies will by default have a content-type of text/plain, while byte-input like Buffer or Readable will default to application/octet-stream.
text/plain
application/octet-stream
Represents any value that can be treated as a body payload in HTTP response handling.
This type is a union of various formats that a body can take, enabling flexibility in providing content.
Response
.string
: A text-based representation of the body content.Buffer
: A binary buffer containing the body data.Uint8Array
: A byte array containing the body data in binary form.Readable
: A Node.js Readable stream.ReadableStream
: A web-standard ReadableStream.null
: Represents an absent or empty body.String bodies will by default have a content-type of
text/plain
, while byte-input likeBuffer
orReadable
will default toapplication/octet-stream
.