Skip to content

[client] Add per-request extra headers#1

Merged
juharris merged 1 commit into
Shopify:mainfrom
dirceu:add-per-request-headers
Jun 26, 2026
Merged

[client] Add per-request extra headers#1
juharris merged 1 commit into
Shopify:mainfrom
dirceu:add-per-request-headers

Conversation

@juharris

@juharris juharris commented Jun 26, 2026

Copy link
Copy Markdown

Same as alexrudall#633


Allow passing custom HTTP headers on individual API calls rather than only at client initialization time. This enables varying headers per request while reusing a single cached client instance.

Changes:

  • HTTP#get, #post, #json_post, #multipart_post, #delete accept extra_headers: {}
  • Client#chat, #embeddings, #completions, #moderations accept extra_headers: {}
  • Added tests for extra_headers functionality

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?

Allow passing custom HTTP headers on individual API calls rather than
only at client initialization time. This enables varying headers per
request while reusing a single cached client instance.

Changes:
- HTTP#get, #post, #json_post, #multipart_post, #delete accept extra_headers: {}
- Client#chat, #embeddings, #completions, #moderations accept extra_headers: {}
- Added tests for extra_headers functionality
@juharris juharris requested a review from tavianator June 26, 2026 19:27
@juharris juharris marked this pull request as ready for review June 26, 2026 19:28
@juharris juharris merged commit a1fc9ca into Shopify:main Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants