Automatically decompress message body if necessary.
HTTP headers.
Optional
options: UploadOptionsGet async iterator for uploaded files from message body.
// Iterate over uploaded files
for await (const {fieldname, file, filename} of body.files()) {
const parts = [];
for await (const chunk of file) {
parts.push(chunk);
}
const content = Buffer.concat(parts).toString();
console.write(${fieldname}: ${content}
);
}
Optional
options: UploadOptionsGet form parameters from message body.
// Get a specific parameter
const params = await body.form();
const foo = params.get('foo');
Optional
options: UploadOptionsGet JSON message body as parsed data structure.
Generated using TypeDoc
HTTP message body base class.