get_method

This commit is contained in:
Martin Algesten
2018-07-02 12:32:01 +02:00
parent 45eb2afc6a
commit 1d541763c6

View File

@@ -464,6 +464,18 @@ impl Request {
// unimplemented!() // unimplemented!()
// } // }
/// Get the method this request is using.
///
/// Example:
/// ```
/// let req = ureq::post("/somewhere")
/// .build();
/// assert_eq!(req.get_method(), "POST");
/// ```
pub fn get_method(&self) -> &str {
&self.method
}
fn to_url(&self) -> Result<Url, Error> { fn to_url(&self) -> Result<Url, Error> {
URL_BASE URL_BASE
.join(&self.path) .join(&self.path)