Skip to content

Commit

Permalink
document how to enable brotli and/or deflate
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Andrews committed Jul 15, 2021
1 parent 2bad5d1 commit 15dfa41
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "goose"
version = "0.12.1"
version = "0.12.2-dev"
authors = ["Jeremy Andrews <[email protected]>"]
edition = "2018"
description = "A load testing framework inspired by Locust."
Expand Down
21 changes: 20 additions & 1 deletion src/goose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,8 @@ impl GooseUser {
///
/// let builder = Client::builder()
/// .user_agent(APP_USER_AGENT)
/// .cookie_store(true);
/// .cookie_store(true)
/// .gzip(true);
/// ```
///
/// Alternatively, you can use this function to manually build a
Expand Down Expand Up @@ -1968,6 +1969,24 @@ impl GooseUser {
/// Ok(())
/// }
/// ```
///
/// Reqwest also supports
/// [`brotli`](https://docs.rs/reqwest/*/reqwest/struct.ClientBuilder.html#method.brotli) and
/// [`deflate`](https://docs.rs/reqwest/*/reqwest/struct.ClientBuilder.html#method.deflate) compression.
///
/// To enable either, you must enable the features in your load test's `Cargo.toml`, for example:
/// ```text
/// reqwest = { version = "^0.11.4", default-features = false, features = [
/// "brotli",
/// "cookies",
/// "deflate",
/// "gzip",
/// "json",
/// ] }
/// ```
///
/// Once enabled, you can add `.brotli(true)` and/or `.deflate(true)` to your custom Client::builder(),
/// similar to how is documented above.
pub async fn set_client_builder(&self, builder: ClientBuilder) -> Result<(), GooseTaskError> {
*self.client.lock().await = builder.build()?;

Expand Down

0 comments on commit 15dfa41

Please sign in to comment.