Skip to content

Commit 1cd8ea3

Browse files
authored
Merge pull request #1144 from Twey/master
client(feat): add an accessor for the request body
2 parents bb7c9b9 + 4e26646 commit 1cd8ea3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/client/request.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl<B> Request<B> {
3333
/// Read the Request Uri.
3434
#[inline]
3535
pub fn uri(&self) -> &Uri { &self.uri }
36-
36+
3737
/// Read the Request Version.
3838
#[inline]
3939
pub fn version(&self) -> HttpVersion { self.version }
@@ -46,6 +46,10 @@ impl<B> Request<B> {
4646
#[inline]
4747
pub fn method(&self) -> &Method { &self.method }
4848

49+
/// Read the Request body.
50+
#[inline]
51+
pub fn body(&self) -> Option<&B> { self.body.as_ref() }
52+
4953
/// Set the Method of this request.
5054
#[inline]
5155
pub fn set_method(&mut self, method: Method) { self.method = method; }

0 commit comments

Comments
 (0)