Is there a way to automatically retry a request gi...
# ktor
t
Is there a way to automatically retry a request given a specific response (for example, HTTP 421) with HttpClient ?
v
Using the okhttp client you can intercept the response, check the code. If code == 421. Make request again.
t
I've had a look at interceptors for HttpClient :
requestPipeline
and
responsePipeline
. The problem is, which phase should I intercept ? How to re-issue a request with the same pipeline as the original ? It seems that when calling
httpClient.execute(...)
, it loses the ability to deserialize Json.