diff --git a/src/lib.rs b/src/lib.rs index b4e8a2b..c2d8dbf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,7 +14,7 @@ //! These top level http method functions create a [Request](struct.Request.html) instance //! which follows a build pattern. The builders are finished using //! [`.call()`](struct.Request.html#method.call), -//! [`.send_str()`](struct.Request.html#method.send_str) or +//! [`.send_string()`](struct.Request.html#method.send_string) or //! [`.send_json()`](struct.Request.html#method.send_json). //! //! # Agents @@ -25,7 +25,7 @@ //! # Content-Length //! //! The library will set the content length on the request when using -//! [`.send_str()`](struct.Request.html#method.send_str) or +//! [`.send_string()`](struct.Request.html#method.send_string) or //! [`.send_json()`](struct.Request.html#method.send_json). In other cases the user //! can optionally `request.set("Content-Length", 1234)`. //! @@ -42,7 +42,7 @@ //! ``` //! let resp = ureq::post("http://my-server.com/ingest") //! .set("Transfer-Encoding", "chunked") -//! .send_str("Hello world"); +//! .send_string("Hello world"); //! ``` extern crate ascii; diff --git a/src/request.rs b/src/request.rs index 5272db7..fe2870e 100644 --- a/src/request.rs +++ b/src/request.rs @@ -186,10 +186,10 @@ impl Request { /// ``` /// let r = ureq::post("/my_page") /// .content_type("text/plain") - /// .send_str("Hello World!"); + /// .send_string("Hello World!"); /// println!("{:?}", r); /// ``` - pub fn send_str(&mut self, data: S) -> Response + pub fn send_string(&mut self, data: S) -> Response where S: Into, { diff --git a/src/response.rs b/src/response.rs index 2bc1737..d79e896 100644 --- a/src/response.rs +++ b/src/response.rs @@ -136,7 +136,7 @@ impl Response { /// Tells if this response is "synthetic". /// /// The [methods](struct.Request.html#method.call) [firing](struct.Request.html#method.send) - /// [off](struct.Request.html#method.send_str) [requests](struct.Request.html#method.send_json) + /// [off](struct.Request.html#method.send_string) [requests](struct.Request.html#method.send_json) /// all return a `Response`; there is no rust style `Result`. /// /// Rather than exposing a custom error type through results, this library has opted diff --git a/src/test/body_send.rs b/src/test/body_send.rs index 7c5ba34..96ca011 100644 --- a/src/test/body_send.rs +++ b/src/test/body_send.rs @@ -8,7 +8,7 @@ fn content_length_on_str() { test::make_response(200, "OK", vec![], vec![]) }); let resp = get("test://host/content_length_on_str") - .send_str("Hello World!!!"); + .send_string("Hello World!!!"); let vec = resp.to_write_vec(); let s = String::from_utf8_lossy(&vec); assert!(s.contains("\r\nContent-Length: 14\r\n")); @@ -21,7 +21,7 @@ fn user_set_content_length_on_str() { }); let resp = get("test://host/user_set_content_length_on_str") .set("Content-Length", "12345") - .send_str("Hello World!!!"); + .send_string("Hello World!!!"); let vec = resp.to_write_vec(); let s = String::from_utf8_lossy(&vec); assert!(s.contains("\r\nContent-Length: 12345\r\n")); @@ -48,7 +48,7 @@ fn content_length_and_chunked() { }); let resp = post("test://host/content_length_and_chunked") .set("Transfer-Encoding", "chunked") - .send_str("Hello World!!!"); + .send_string("Hello World!!!"); let vec = resp.to_write_vec(); let s = String::from_utf8_lossy(&vec); assert!(s.contains("Transfer-Encoding: chunked\r\n")); diff --git a/src/test/range.rs b/src/test/range.rs index 7e07087..d0dcc26 100644 --- a/src/test/range.rs +++ b/src/test/range.rs @@ -1,5 +1,4 @@ use std::io::Read; -use test; use super::super::*;