Struct edge::Response [] [src]

pub struct Response<'a> { /* fields omitted */ }

Methods

impl<'a> Response<'a>
[src]

Sets the status code of this response.

Sets the Content-Type header.

Sets the Content-Length header.

Sets the Location header.

Redirects to the given URL with the given status, or 302 Found if none is given.

Sets the given header.

Sets the given header with raw strings.

Ends this response with the given status and an empty body

Sends the given content and ends this response. Status defaults to 200 Ok, headers must have been set before this method is called.

Sends the given file, setting the Content-Type based on the file's extension. Known extensions are htm, html, jpg, jpeg, png, js, css. If the file does not exist, this method sends a 404 Not Found response.

Writes the body of this response using the given source function.

Sets a cookie with the given name and value. If set, the set_options function will be called to update the cookie's options.