pub fn text_with_charset(&mut self, default_encoding: &str) -> crate::Result<String> {
        wait::timeout(self.inner.text_with_charset(default_encoding), self.timeout).map_err(|e| {
            match e {
                wait::Waited::TimedOut => crate::error::timedout(None),
                wait::Waited::Executor(e) => crate::error::from(e),
                wait::Waited::Inner(e) => e,
            }
        })
    }
/// Get the response text given a specific encoding.
///
/// This method decodes the response body with BOM sniffing
/// and with malformed sequences replaced with the REPLACEMENT CHARACTER.
/// You can provide a default encoding for decoding the raw message, while the
/// `charset` parameter of `Content-Type` header is still prioritized. For more information
/// about the possible encoding name, please go to
/// https://docs.rs/encoding_rs/0.8.17/encoding_rs/#relationship-with-windows-code-pages
///
/// # Example
///
/// ```rust
/// # extern crate reqwest;
/// # fn run() -> Result<(), Box<std::error::Error>> {
/// let content = reqwest::get("http://httpbin.org/range/26")?.text_with_charset("utf-8")?;
/// # Ok(())
/// # }
/// ```
///
/// # Note
///
/// This consumes the body. Trying to read more, or use of `response.json()`
/// will return empty values.
Get the response text given a specific encoding.
This method decodes the response body with BOM sniffing
and with malformed sequences replaced with the REPLACEMENT CHARACTER.
You can provide a default encoding for decoding the raw message, while the
`charset` parameter of `Content-Type` header is still prioritized.
Get the response text given a specific encoding . This method decodes the response body with BOM sniffing and with malformed sequences replaced with the REPLACEMENT CHARACTER . You can provide a default encoding for decoding the raw message while the ` charset ` parameter of ` Content - Type ` header is still prioritized .
pub fn text_with_charset(&mut self, default_encoding: &str) -> crate::Result<String> {
        wait::timeout(self.inner.text_with_charset(default_encoding), self.timeout).map_err(|e| {
            match e {
                wait::Waited::TimedOut => crate::error::timedout(None),
                wait::Waited::Executor(e) => crate::error::from(e),
                wait::Waited::Inner(e) => e,
            }
        })
    }
pub fn text_with_charset ( & mut self , default_encoding : & str ) -> crate :: Result < String > { wait :: timeout ( self . inner . text_with_charset ( default_encoding ) , self . timeout ) . map_err ( | e | { match e { wait :: Waited :: TimedOut => crate :: error :: timedout ( None ) , wait :: Waited :: Executor ( e ) => crate :: error :: from ( e ) , wait :: Waited :: Inner ( e ) => e , } } ) }
Get the response text given a specific encoding.
Get the response text given a specific encoding .
&mut self
default_encoding
&str
&mut self
default_encoding
&str
example
None
extern crate reqwest;
None
fn run() -> result<(), box<std::error::error>> {
None
ok(())
None
}
None
note
This consumes the body. Trying to read more, or use of `response.json()`
will return empty values.
This consumes the body . Trying to read more or use of ` response . json () ` will return empty values .