This commit is contained in:
Martin Algesten
2018-06-16 12:07:21 +02:00
parent 773c82b4c6
commit 0d9d5d3096
2 changed files with 25 additions and 0 deletions

View File

@@ -22,6 +22,28 @@
//! To maintain a state, cookies, between requests, you use an [agent](struct.Agent.html).
//! Agents also follow the build pattern. Agents are created with `ureq::agent().build()`.
//!
//! # Content-Length
//!
//! The library will set the content length on the request when using
//! [`.send_str()`](struct.Request.html#method.send_str) or
//! [`.send_json()`](struct.Request.html#method.send_json). In other cases the user
//! can optionally `request.set("Content-Length", 1234)`.
//!
//! For responses, if the `Content-Length` header is present, the methods that reads the
//! body (as string, json or read trait) are all limited to the length specified in the header.
//!
//! # Transfer-Encoding: chunked
//!
//! Dechunking is a response body is done automatically if the response headers contains
//! a `Transfer-Encoding` header.
//!
//! Sending a chunked request body is done by setting the header prior to sending a body.
//!
//! ```
//! let resp = ureq::post("http://my-server.com/ingest")
//! .set("Transfer-Encoding", "chunked")`
//! .send("Hello world");
//! ```
extern crate ascii;
extern crate base64;