diff --git a/src/blocking/request.rs b/src/blocking/request.rs index 94f89b46a..9acc1e16a 100644 --- a/src/blocking/request.rs +++ b/src/blocking/request.rs @@ -167,6 +167,14 @@ impl RequestBuilder { } } + /// Assemble a builder starting from an existing `Client` and a `Request`. + pub fn from_parts(client: Client, request: Request) -> RequestBuilder { + RequestBuilder { + client, + request: crate::Result::Ok(request), + } + } + /// Add a `Header` to this Request. /// /// ```rust @@ -550,6 +558,15 @@ impl RequestBuilder { self.request } + /// Build a `Request`, which can be inspected, modified and executed with + /// `Client::execute()`. + /// + /// This is similar to [`RequestBuilder::build()`], but also returns the + /// embedded `Client`. + pub fn build_split(self) -> (Client, crate::Result) { + (self.client, self.request) + } + /// Constructs the Request and sends it the target URL, returning a Response. /// /// # Errors