diff --git a/src/request.rs b/src/request.rs index 6c7f830..943ab2e 100644 --- a/src/request.rs +++ b/src/request.rs @@ -476,6 +476,20 @@ impl Request { &self.method } + /// Get the url this request was created with. + /// + /// This value is not normalized, it is exactly as set. + /// + /// Example: + /// ``` + /// let req = ureq::post("https://cool.server/innit") + /// .build(); + /// assert_eq!(req.get_url(), "https://cool.server/innit"); + /// ``` + pub fn get_url(&self) -> &str { + &self.path + } + fn to_url(&self) -> Result { URL_BASE .join(&self.path)