in lambda-http/src/ext.rs [349:367]
fn requests_match_form_post_content_type_with_charset() {
#[derive(Deserialize, PartialEq, Debug)]
struct Payload {
foo: String,
baz: usize,
}
let request = http::Request::builder()
.header("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8")
.body(Body::from("foo=bar&baz=2"))
.expect("failed to build request");
let payload: Option<Payload> = request.payload().unwrap_or_default();
assert_eq!(
payload,
Some(Payload {
foo: "bar".into(),
baz: 2
})
);
}