feat(client): add Request.set_uri(RequestUri) method (#803)

This commit is contained in:
Sean McArthur
2016-05-24 11:38:11 -07:00
parent ce3dbd123d
commit cee36d4305

View File

@@ -38,6 +38,14 @@ impl<'a> Request<'a> {
/// Get a mutable reference to the Request headers.
#[inline]
pub fn headers_mut(&mut self) -> &mut Headers { &mut self.head.headers }
/// Set the `RequestUri` of this request.
#[inline]
pub fn set_uri(&mut self, uri: RequestUri) { self.head.subject.1 = uri; }
/// Set the `HttpVersion` of this request.
#[inline]
pub fn set_version(&mut self, version: HttpVersion) { self.head.version = version; }
}
pub fn new(head: &mut RequestHead) -> Request {