From cf5deac02dfcab5b3d7834fd04d32e013ac099b1 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Thu, 31 May 2018 12:01:44 -0700 Subject: [PATCH] document that Response::text consumes the body Closes #302 --- src/response.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/response.rs b/src/response.rs index 6cfab3a..9058aad 100644 --- a/src/response.rs +++ b/src/response.rs @@ -183,6 +183,11 @@ impl Response { /// # Ok(()) /// # } /// ``` + /// + /// # Note + /// + /// This consumes the body. Trying to read more, or use of `response.json()` + /// will return empty values. pub fn text(&mut self) -> ::Result { let len = self.headers().get::<::header::ContentLength>() .map(|ct_len| **ct_len)