when using Ktor client, is there a way to intercept a single request when making the call? https://ktor.io/docs/client-http-send.html looks like it'll intercept all calls on that client instance; I need to compute a signature over the request body and set it as a header for a single request
✅ 1
j
jamshedalamqaderi
10/16/2025, 12:49 PM
You have to filter out which request you want to intercept and also use in memory or persistent key value storage to save the value that you already have intercepted
b
Bernhard
10/16/2025, 12:59 PM
ok, thanks; I suppose in that I case I want to manually serialize JSON, create the hash/signature over that and use a text body
Bernhard
10/16/2025, 1:03 PM
though in that case, I think I need to pass the json serializer manually, there's no way to get that from the client, correct?
p
phldavies
10/16/2025, 1:05 PM
I wonder if you could put the interception logic as a lambda into the request attributes when building the request, and have an interceptor that pulls it out (if present) and otherwise does nothing?