Hi, I'm trying to use <https://ktor.io/docs/respon...
# ktor
d
Hi, I'm trying to use https://ktor.io/docs/response-validation.html#2xx and in there to use request attributes so, something like:
Copy code
httpClient.get("/whatever") {
   attributes.put("operation", "whatever")
}
and then in my validator:
Copy code
val client = HttpClient(CIO) {
    install(ContentNegotiation) { json() }
    HttpResponseValidator {
        validateResponse { response ->
          if response.request.attributes["operation"] == "whatever"
          //whatever
        }
    }
}
is this possible at all
so, i don't want to do retarted stuff, like check which url/path/query params/headers were passed in order to figure out what the request was, but rather have explicit control over it
a
Your solution with
Attributes
should work.