Skip to content

Commit b8180b3

Browse files
docs(readme): example snippet for client context manager
1 parent d31547b commit b8180b3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: README.md

+10
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,16 @@ client.with_options(http_client=DefaultHttpxClient(...))
296296

297297
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.
298298

299+
```py
300+
from gitpod import Gitpod
301+
302+
with Gitpod() as client:
303+
# make requests here
304+
...
305+
306+
# HTTP client is now closed
307+
```
308+
299309
## Versioning
300310

301311
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)