improve docs around Body type

This commit is contained in:
Sean McArthur
2017-07-13 12:17:06 -07:00
parent 12ee6fbcde
commit fb4dd2e0b3
2 changed files with 18 additions and 5 deletions

View File

@@ -156,6 +156,10 @@ impl RequestBuilder {
/// Set the request body.
///
/// # Examples
///
/// Using a string:
///
/// ```rust
/// # fn run() -> Result<(), Box<::std::error::Error>> {
/// let client = reqwest::Client::new()?;
@@ -166,6 +170,8 @@ impl RequestBuilder {
/// # }
/// ```
///
/// Using a `File`:
///
/// ```rust
/// # use std::fs;
/// # fn run() -> Result<(), Box<::std::error::Error>> {
@@ -178,6 +184,8 @@ impl RequestBuilder {
/// # }
/// ```
///
/// Using arbitrary bytes:
///
/// ```rust
/// # use std::fs;
/// # fn run() -> Result<(), Box<::std::error::Error>> {