impl get_body method in request to get json body data

This commit is contained in:
landrigun 2023-02-15 14:20:55 +00:00
parent ad4fdc300d
commit c4e46581a9

View File

@ -66,6 +66,14 @@ impl<'a> HTTPRequest<'a> {
}
}
/// get_body returns the body data as JsonValue
pub fn get_body(&self) -> Option<&JsonValue> {
match self.body {
Some(ref b) => Some(b.get_data()),
None => None,
}
}
pub fn get_target(&self) -> &str {
self.start_line.get_target()
}