Hi all. I’m trying to write a plugin for ktor clie...
# ktor
e
Hi all. I’m trying to write a plugin for ktor client that will look for certain request URL patterns, and when matching, simulate a server error response (without actually sending the request over the network). This is to help QA test server failures in our mobile app. I can’t find a way to do that using the simplified plugin interface, so I’m guessing I need to use the base API, but I’m having trouble figuring out the best way to do that. Any help would be appreciated.
a
You can intercept the
HttpSendPipeline
to simulate a server response, I recommend looking into the implementation of the HttpCache plugin to see how to finish the pipeline without sending the request.
1
e
Perfect. Thanks!