hi everyone, I have some api stubs and I want to b...
# ktor
h
hi everyone, I have some api stubs and I want to be able to switch between network-request and local-storage to get the response on runtime. i digged into ktor code and it looks like i have to implement HttpclientEngine and its “actual” implementations for Android and iOS! it looks like a lot of work, so i thought there must be a light way to intercept requests and provide the response. I cannot find an example for it. any guide/example to share? thanks in advance.
a
You can intercept the
HttpSendPipeline
in any phase before the
Engine
phase to be able to finish the pipeline execution to effectively avoid the network call. You can find an example of such interception in the HttpCache plugin.