when using `HttpRequestBuilder` to build a request...
# ktor
b
when using
HttpRequestBuilder
to build a request, is there any way to set some “metadata” on the request? Maybe the
attribiutes
property? What do I mean by “metadata”? I’m looking to set some data (key/value pair) on a request, that’s not actually sent along with the request (so, not a header, or query param, etc). A use case might be a custom HttpClient plugin that needs to do different things for different kinds of requests. Or using the Auth plugin’s
sendWithoutRequest
method to include bearer tokens on some requests automatically.
e
Hey @Bradleycorn, thanks for the question. Yep, Attributes is a way to go. You can create your own typed AttributeKey and store some data you need for plugins or for response
👍 1