shorter doc examples
This commit is contained in:
@@ -233,7 +233,8 @@ impl Response {
|
|||||||
/// use std::io::Read;
|
/// use std::io::Read;
|
||||||
///
|
///
|
||||||
/// let resp =
|
/// let resp =
|
||||||
/// ureq::get("https://raw.githubusercontent.com/algesten/ureq/master/.gitignore").call();
|
/// ureq::get("https://s3.amazonaws.com/foosrvr/hello_world.json")
|
||||||
|
/// .call();
|
||||||
///
|
///
|
||||||
/// assert!(resp.has("Content-Length"));
|
/// assert!(resp.has("Content-Length"));
|
||||||
/// let len = resp.header("Content-Length")
|
/// let len = resp.header("Content-Length")
|
||||||
@@ -272,11 +273,12 @@ impl Response {
|
|||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// let resp =
|
/// let resp =
|
||||||
/// ureq::get("https://raw.githubusercontent.com/algesten/ureq/master/.gitignore").call();
|
/// ureq::get("https://s3.amazonaws.com/foosrvr/hello_world.json")
|
||||||
|
/// .call();
|
||||||
///
|
///
|
||||||
/// let text = resp.into_string().unwrap();
|
/// let text = resp.into_string().unwrap();
|
||||||
///
|
///
|
||||||
/// assert!(text.contains("target"));
|
/// assert!(text.contains("hello"));
|
||||||
/// ```
|
/// ```
|
||||||
pub fn into_string(self) -> IoResult<String> {
|
pub fn into_string(self) -> IoResult<String> {
|
||||||
let encoding = encoding_from_whatwg_label(self.charset())
|
let encoding = encoding_from_whatwg_label(self.charset())
|
||||||
@@ -293,7 +295,8 @@ impl Response {
|
|||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// let resp =
|
/// let resp =
|
||||||
/// ureq::get("https://s3.amazonaws.com/foosrvr/hello_world.json").call();
|
/// ureq::get("https://s3.amazonaws.com/foosrvr/hello_world.json")
|
||||||
|
/// .call();
|
||||||
///
|
///
|
||||||
/// let json = resp.into_json().unwrap();
|
/// let json = resp.into_json().unwrap();
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"hello": "world"
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user