diff --git a/src/client/request.rs b/src/client/request.rs index 1f564753a..c5c95eb82 100644 --- a/src/client/request.rs +++ b/src/client/request.rs @@ -599,3 +599,19 @@ fn parts<'a>(parts: &'a mut Option, err: &Option) } parts.as_mut() } + +impl fmt::Debug for ClientRequestBuilder { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + if let Some(ref parts) = self.request { + let res = write!(f, "\nClientRequestBuilder {:?} {}:{}\n", + parts.version, parts.method, parts.uri); + let _ = write!(f, " headers:\n"); + for (key, val) in parts.headers.iter() { + let _ = write!(f, " {:?}: {:?}\n", key, val); + } + res + } else { + write!(f, "ClientRequestBuilder(Consumed)") + } + } +}