Skip to content

Commit 4ca06b8

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
docs(readme): example snippet for client context manager (#657)
1 parent 6412dcd commit 4ca06b8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,16 @@ client.with_options(http_client=DefaultHttpxClient(...))
428428

429429
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.
430430

431+
```py
432+
from lithic import Lithic
433+
434+
with Lithic() as client:
435+
# make requests here
436+
...
437+
438+
# HTTP client is now closed
439+
```
440+
431441
## Versioning
432442

433443
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:

0 commit comments

Comments
 (0)