Automatically decompress message body if necessary.
HTTP headers.
HTTP version.
Response status code.
Response status message.
Check if response has a 4xx
response status code.
Check if response has a 4xx
or 5xx
response status code.
Check if response has a 3xx
response status code.
Check if response has a 5xx
response status code.
Check if response has a 2xx
response status code.
Get Content-Type
header value.
Optional
options: UploadOptionsGet async iterator for uploaded files from message body.
Optional
options: UploadOptions// 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}`);
}
Get form parameters from message body.
Optional
options: UploadOptions// Get a specific parameter
const params = await body.form();
const foo = params.get('foo');
Get JSON message body as parsed data structure.
Set HTTP header for message. // Set Server header body.set('Server', 'mojo.js');
Generated using TypeDoc
User-agent response class.