small improvements to docs

This commit is contained in:
Sean McArthur
2017-07-13 11:59:45 -07:00
parent 21e050dedf
commit 12ee6fbcde
2 changed files with 39 additions and 20 deletions

View File

@@ -27,6 +27,8 @@ impl fmt::Debug for Response {
impl Response {
/// Get the final `Url` of this `Response`.
///
/// # Example
///
/// ```rust
/// # fn run() -> Result<(), Box<::std::error::Error>> {
/// let resp = reqwest::get("http://httpbin.org/redirect/1")?;
@@ -41,6 +43,8 @@ impl Response {
/// Get the `StatusCode` of this `Response`.
///
/// # Examples
///
/// ```rust
/// # fn run() -> Result<(), Box<::std::error::Error>> {
/// let resp = reqwest::get("http://httpbin.org/get")?;
@@ -80,6 +84,10 @@ impl Response {
/// Get the `Headers` of this `Response`.
///
/// # Example
///
/// Checking the `Content-Length` header before reading the response body.
///
/// ```rust
/// # use std::io::{Read, Write};
/// # use reqwest::Client;