get_method
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user