Files
hyper/tests/integration.rs
Sean McArthur c4974500ab feat(server): re-design Server as higher-level API
The `hyper::Server` is now a proper higher-level API for running HTTP
servers. There is a related `hyper::server::Builder` type, to construct
a `Server`. All other types (`Http`, `Serve`, etc) were moved into the
"lower-level" `hyper::server::conn` module.

The `Server` is a `Future` representing a listening HTTP server. Options
needed to build one are set on the `Builder`.

As `Server` is just a `Future`, it no longer owns a thread-blocking
executor, and can thus be run next to other servers, clients, or
what-have-you.

Closes #1322
Closes #1263

BREAKING CHANGE: The `Server` is no longer created from `Http::bind`,
  nor is it `run`. It is a `Future` that must be polled by an
  `Executor`.

  The `hyper::server::Http` type has move to
  `hyper::server::conn::Http`.
2018-04-16 14:29:19 -07:00

148 lines
2.5 KiB
Rust

#![deny(warnings)]
#[macro_use]
mod support;
use self::support::*;
t! {
get_1,
client:
request:
uri: "/",
;
response:
status: 200,
;
server:
request:
uri: "/",
;
response:
;
}
t! {
get_implicit_path,
client:
request:
uri: "",
;
response:
status: 200,
;
server:
request:
uri: "/",
;
response:
;
}
t! {
get_body,
client:
request:
uri: "/",
;
response:
status: 200,
headers: {
"content-length" => 11,
},
body: "hello world",
;
server:
request:
uri: "/",
;
response:
headers: {
"content-length" => 11,
},
body: "hello world",
;
}
t! {
get_body_chunked,
client:
request:
uri: "/",
;
response:
status: 200,
headers: {
// h2 doesn't actually receive the transfer-encoding header
},
body: "hello world",
;
server:
request:
uri: "/",
;
response:
headers: {
// http2 should strip this header
"transfer-encoding" => "chunked",
},
body: "hello world",
;
}
t! {
post_chunked,
client:
request:
method: "POST",
uri: "/post_chunked",
headers: {
// http2 should strip this header
"transfer-encoding" => "chunked",
},
body: "hello world",
;
response:
;
server:
request:
method: "POST",
uri: "/post_chunked",
body: "hello world",
;
response:
;
}
t! {
get_2,
client:
request:
uri: "/1",
;
response:
status: 200,
;
request:
uri: "/2",
;
response:
status: 200,
;
server:
request:
uri: "/1",
;
response:
;
request:
uri: "/2",
;
response:
;
}
t! {
get_parallel_http2,
parallel: 0..10
}