Skip to content

feat: add custom headers support via .header() on client builder#273

Merged
dancixx merged 6 commits intodevfrom
feat/custom-headers-builder
Feb 27, 2026
Merged

feat: add custom headers support via .header() on client builder#273
dancixx merged 6 commits intodevfrom
feat/custom-headers-builder

Conversation

@generall
Copy link
Member

Adds the ability to set custom headers on the Qdrant client so they are sent with every request (gRPC and REST).

Changes

  • QdrantConfig (config.rs): New custom_headers: Vec<(String, String)> field and .header(key, value) builder method. Can be chained to add multiple headers.
  • TokenInterceptor (auth.rs): Injects custom headers into gRPC request metadata (after api-key).
  • download_snapshot (snapshot.rs, download_snapshots feature): Builds the REST request with a reqwest::Client and adds api_key + custom headers instead of plain reqwest::get().

Usage

use qdrant_client::Qdrant;

let client = Qdrant::from_url("http://localhost:6334")
    .header("x-custom-id", "my-client")
    .header("x-request-source", "batch-job")
    .api_key(std::env::var("QDRANT_API_KEY"))
    .build()?;

Custom headers are sent on all gRPC calls and on snapshot download (REST) when using the download_snapshots feature.

Made with Cursor

@generall generall mentioned this pull request Feb 27, 2026
9 tasks
@generall generall changed the base branch from master to dev February 27, 2026 00:12
Cursor Agent and others added 4 commits February 27, 2026 00:13
- QdrantConfig: add custom_headers field and .header(key, value) builder method
- TokenInterceptor: inject custom headers into all gRPC request metadata
- download_snapshot: send api_key and custom headers on REST snapshot download

Allows setting one or multiple custom headers when building the client, e.g.:
  Qdrant::from_url("http://localhost:6334")
    .header("x-custom-id", "my-client")
    .header("x-request-source", "batch-job")
    .build()

Made-with: Cursor
@generall generall force-pushed the feat/custom-headers-builder branch from 598a448 to 79e6d56 Compare February 27, 2026 00:13
@generall generall requested a review from dancixx February 27, 2026 12:38
@dancixx dancixx force-pushed the feat/custom-headers-builder branch from 1888337 to 5614833 Compare February 27, 2026 13:10
@dancixx dancixx merged commit c80e768 into dev Feb 27, 2026
2 checks passed
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