typesense-python icon indicating copy to clipboard operation
typesense-python copied to clipboard

Support for additional request headers ?

Open brnkes opened this issue 1 year ago • 1 comments

Description

My cluster is behind a proxy & I need to include additional headers to reach out to it. This is not possible with the Python library. The only header being passed is the api key :

https://github.com/typesense/typesense-python/blob/5d1b7402dbc1131c5dc8dc5eae66d05f71d14311/src/typesense/api_call.py#L101

Expected Behavior

Client constructor should accept a new field :

self.client = Client({
            'nodes': [...],
            'api_key': '..',
            'connection_timeout_seconds': 5,
            'additional_headers': {
                'X-QWE-RTY': 'foobarbaz'
            }
        })

Something similar is already implemented by the Javascript library : https://github.com/typesense/typesense-js/issues/79

Metadata

Typesense Version: 27.0.rc22

Python SDK Version: 0.21.0

brnkes avatar Jul 08 '24 22:07 brnkes

You can take a look at #60 to verify if this matches your usecase

tharropoulos avatar Sep 16 '24 14:09 tharropoulos

this is added in version 1.0.3

vkgyl avatar Mar 20 '25 10:03 vkgyl