Skip to content

Commit acf544b

Browse files
authored
Merge pull request #9 from wacker-dev/form
Add the form method for Request/Response
2 parents 67c450f + 3e96b0f commit acf544b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

waki/src/common/request_and_response.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ macro_rules! impl_common_get_methods {
6767
Ok(serde_json::from_slice(self.body()?.as_ref())?)
6868
}
6969

70+
/// Parse the body as form data.
71+
pub fn form(self) -> Result<HashMap<String, String>> {
72+
Ok(serde_urlencoded::from_bytes(self.body()?.as_ref())?)
73+
}
74+
7075
/// Parse the body as multipart/form-data.
7176
///
7277
/// # Optional

0 commit comments

Comments
 (0)