http-rs / surf

Fast and friendly HTTP client framework for async Rust
https://docs.rs/surf
Apache License 2.0
1.45k stars 119 forks source link

RequestBuilder: use shared client internally if available #231

Closed Fishrock123 closed 3 years ago

Fishrock123 commented 3 years ago

This should help reduce overhead from creating new Isahc clients.

See https://docs.rs/isahc/0.9.8/isahc/struct.HttpClient.html

From Isahc's Docs:

The client maintains a connection pool internally and is not cheap to create ...

This may be possible without https://github.com/http-rs/surf/pull/230 but was much easier to do with those config feature changes.