reduce dependency tree by features

This commit is contained in:
Martin Algesten
2018-06-22 14:03:25 +02:00
parent 20bb7cbbde
commit cd4a1722fa
9 changed files with 140 additions and 42 deletions

View File

@@ -5,6 +5,7 @@
## Usage
```rust
// requires feature: `ureq = { version = "*", features = ["json"] }`
#[macro_use]
extern crate ureq;
@@ -25,6 +26,21 @@ fn main() {
}
```
## Features
To enable a minimal dependency tree, some features are off by default.
You can control them when including `ureq` as a dependency.
```
ureq = { version = "*", features = ["json", "charset"] }
```
* `tls` enables https. This is enabled by default.
* `json` enables `response.into_json()` and `request.send_json()` serde json.
* `charset` enables interpreting the charset part of
`Content-Type: text/plain; charset=iso-8859-1`. Without this, the library
defaults to rust's built in `utf-8`.
## Motivation
* Minimal dependency tree