Function aws_smithy_client::test_connection::capture_request
source · [−]pub fn capture_request(
response: Option<Response<SdkBody>>
) -> (CaptureRequestHandler, CaptureRequestReceiver)
Expand description
Test connection used to capture a single request
If response is None
, it will reply with a 200 response with an empty body
Example:
ⓘ
let (server, request) = capture_request(None);
let client = aws_sdk_sts::Client::from_conf_conn(conf, server);
let _ = client.assume_role_with_saml().send().await;
// web identity should be unsigned
assert_eq!(
request.expect_request().headers().get("AUTHORIZATION"),
None
);