Package io.qdrant.client
Class RequestHeaders
java.lang.Object
io.qdrant.client.RequestHeaders
Utilities for attaching per-request headers to gRPC calls.
Context ctx = RequestHeaders.withHeader(Context.current(), "x-request-id", "abc-123");
ctx.run(() -> client.listCollectionsAsync());
-
Method Summary
Modifier and TypeMethodDescriptionstatic io.grpc.ContextwithHeader(io.grpc.Context ctx, String key, String value) Returns a newContextthat carries key/value as a gRPC metadata header on every request started within that context.static io.grpc.ContextwithHeaders(io.grpc.Context ctx, Map<String, String> headers) Returns a newContextthat carries all entries of headers as gRPC metadata on every request started within that context.
-
Method Details
-
withHeader
Returns a newContextthat carries key/value as a gRPC metadata header on every request started within that context.- Parameters:
ctx- the parent contextkey- the header namevalue- the header value- Returns:
- a child context with the header attached
-
withHeaders
Returns a newContextthat carries all entries of headers as gRPC metadata on every request started within that context.- Parameters:
ctx- the parent contextheaders- the headers to attach- Returns:
- a child context with the headers attached
-