Skip to content

Commit

Permalink
docs: include some example of how to use additional headers
Browse files Browse the repository at this point in the history
  • Loading branch information
frascuchon committed Sep 21, 2022
1 parent 0199aaf commit d6e9fe4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rubrix/client/api.py
Expand Up @@ -128,11 +128,15 @@ def __init__(
workspace: The workspace to which records will be logged/loaded. If `None` (default) and the
env variable ``RUBRIX_WORKSPACE`` is not set, it will default to the private user workspace.
timeout: Wait `timeout` seconds for the connection to timeout. Default: 60.
extra_headers: Extra http headers sent to the server. Default: `None`
extra_headers: Extra http headers sent to the server. You can use this for customize
client requests if you have some security restrictions. Default: `None`.
Examples:
>>> import rubrix as rb
>>> rb.init(api_url="http://localhost:9090", api_key="4AkeAPIk3Y")
Customizing request headers:
>>> rb.init(api_url="http://localhost:9090", api_key="4AkeAPIk3Y", extra_headers={"X-Client-id":"id","X-Secret":"secret"})
"""
api_url = api_url or os.getenv("RUBRIX_API_URL", "http://localhost:6900")
# Checking that the api_url does not end in '/'
Expand Down

0 comments on commit d6e9fe4

Please sign in to comment.