pub trait HttpConnector: Send + Sync + Debug {
// Required method
fn call(&self, request: HttpRequest) -> BoxFuture<HttpResponse>;
}
Expand description
Trait with a call
function that asynchronously converts a request into a response.
Ordinarily, a connector would use an underlying HTTP library such as hyper, and any associated HTTPS implementation alongside it to service requests.
However, it can also be useful to create fake connectors implementing this trait for testing.
Required Methods§
sourcefn call(&self, request: HttpRequest) -> BoxFuture<HttpResponse>
fn call(&self, request: HttpRequest) -> BoxFuture<HttpResponse>
Asynchronously converts a request into a response.