pub type Response = Response<Body>;
Expand description
An HTTP response.
You can create a response with the new
method:
let response = Response::new(Body::new("Hello world!"));
Or with a ResponseBuilder
:
let response = ResponseBuilder::new()
.status(404)
.header("X-Custom-Foo", "Bar")
.body(Body::new("Page not found."))
.unwrap();
See http::Response
and Body
for details.
Aliased Type§
struct Response { /* private fields */ }