Skip to content

Allow Custom Headers in Requests #28

@sbarbett

Description

@sbarbett

Summary:

Modify the Python SDK's HTTP request wrapper to allow users to define custom headers when instantiating the client. These headers should be stored in the connection module and automatically appended to every request.

Description:

Currently, the SDK does not support user-defined headers globally across requests. This change will introduce a parameter to the client initialization, allowing users to specify custom headers. These headers should be stored in the connection object and merged with per-request headers before sending a request.

Requires:

  • Add a custom_headers parameter to the client constructor.
  • Store custom_headers in the connection module.
  • Modify the request wrapper to merge custom_headers with per-request headers.
  • Ensure that per-request headers override global headers when there is a conflict.
  • Update documentation and examples.

Considerations:

  • Should we allow modification of headers after the client is instantiated?
  • We must handle headers like Authorization that already exist in SDK-generated requests.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions