Append additional header field with value val.
Example:
res.append('Set-Cookie', 'foo=bar; Path=/; HttpOnly'); res.append('Warning', '199 Miscellaneous warning');
for chaining
Set Content-Disposition header to attachment with optional filename.
for chaining
Clear a cookie.
for chaining
Set a cookie. Sets the cookie path to "/" if not defined.
Examples:
// "Remember Me" for 15 minutes res.cookie({ name: "rememberme", value: "1", expires: new Date(Date.now() + 900000), httpOnly: true });
for chaining
Transfer the file at the given path as an attachment.
Optionally providing an alternate attachment filename.
This function will set the Content-Disposition header, overriding
any existing Content-Disposition header in order to set the attachment
and filename.
This method uses res.sendFile().
Ends the response process.
Sets an ETag header.
for chaining
Get value for header field.
the header
Send JSON response.
Examples:
res.json(null);
res.json({ user: 'tj' });
for chaining
Send JSON response with JSONP callback support.
Examples:
res.jsonp(null);
res.jsonp({ user: 'tj' });
for chaining
Set Link header field with the given links.
Examples:
res.links({ next: 'http://api.example.com/users?page=2', last: 'http://api.example.com/users?page=5' });
for chaining
Set the location header to url.
The given url can also be "back", which redirects
to the Referrer or Referer headers or "/".
Examples:
res.location('/foo/bar').; res.location('http://example.com'); res.location('../login');
for chaining
Send a response.
Examples:
res.send({ some: 'json' });
res.send('<p>some html</p>');
for chaining
Transfer the file at the given path.
Automatically sets the Content-Type response header field.
Send given HTTP status code.
Sets the response status to code and the body of the
response to the standard description from deno's http_status.STATUS_TEXT
or the code number if no description.
Examples:
res.sendStatus(200);
for chaining
Set header field to value, or pass
an object of header fields.
Examples:
res.set('Accept', 'application/json');
for chaining
Set status code.
This method deviates from Express due to the naming clash
with Deno.Response status property.
for chaining
Set Content-Type response header with type.
Examples:
res.type('.html');
res.type('html');
res.type('json');
res.type('application/json');
res.type('png');
for chaining
Deletes a header.
for chaining
Generated using TypeDoc
Response class.