Struct axum_test::TestServerConfig
source · pub struct TestServerConfig {
pub default_content_type: Option<String>,
pub socket_address: Option<SocketAddr>,
pub save_cookies: bool,
}Expand description
The basic setup for the TestServer.
Fields§
§default_content_type: Option<String>When performing a request, the request will default to this content type. Set this to set the content type for all requests (which individually they can override). For example you may set all requests to use ‘application/json’.
If this is not set (i.e. set to None), then a best efforts approach will be used by requests.
Where it will guess an appropriate content type to use.
socket_address: Option<SocketAddr>Set the socket to use for the server.
Defaults to a random socket.
Set for the server to save cookies that are returned, for use in future requests.
This is useful for automatically saving session cookies (and similar) like a browser would do.
Defaults to false (being turned off).
Trait Implementations§
source§impl Clone for TestServerConfig
impl Clone for TestServerConfig
source§fn clone(&self) -> TestServerConfig
fn clone(&self) -> TestServerConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more