From 4f5257a70260bb1ef6e4e8d053a10db469b2fb1b Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Thu, 18 Jul 2024 16:53:13 +0000 Subject: [PATCH] chore(docs): document how to do per-request http client customization --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index adcf6585..9cc88d0e 100644 --- a/README.md +++ b/README.md @@ -369,6 +369,12 @@ client = Finch( ) ``` +You can also customize the client on a per-request basis by using `with_options()`: + +```python +client.with_options(http_client=DefaultHttpxClient(...)) +``` + ### Managing HTTP resources By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.