Struct actix_web::HttpResponseBuilder
[−]
[src]
pub struct HttpResponseBuilder { /* fields omitted */ }
An HTTP response builder
This type can be used to construct an instance of HttpResponse
through a
builder-like pattern.
Methods
impl HttpResponseBuilder
[src]
fn version(&mut self, version: Version) -> &mut Self
[src]
Get the HTTP version of this response.
fn status(&mut self, status: StatusCode) -> &mut Self
[src]
Set the StatusCode
for this response.
fn header<K, V>(&mut self, key: K, value: V) -> &mut Self where
HeaderName: HttpTryFrom<K>,
HeaderValue: HttpTryFrom<V>,
[src]
HeaderName: HttpTryFrom<K>,
HeaderValue: HttpTryFrom<V>,
Set a header.
fn reason(&mut self, reason: &'static str) -> &mut Self
[src]
Set the custom reason for the response.
fn connection_type(&mut self, conn: ConnectionType) -> &mut Self
[src]
Set connection type
fn upgrade(&mut self) -> &mut Self
[src]
Set connection type to Upgrade
fn force_close(&mut self) -> &mut Self
[src]
Force close connection, even if it is marked as keep-alive
fn enable_chunked(&mut self) -> &mut Self
[src]
Enables automatic chunked transfer encoding
fn content_type<V>(&mut self, value: V) -> &mut Self where
HeaderValue: HttpTryFrom<V>,
[src]
HeaderValue: HttpTryFrom<V>,
Set response content type
[src]
Set a cookie
[src]
Remote cookie, cookie has to be cookie from HttpRequest::cookies()
method.
fn body<B: Into<Body>>(&mut self, body: B) -> Result<HttpResponse, HttpError>
[src]
Set a body