divyanshunegi
07/07/2021, 5:05 PM401
in that case retry the call after making a new token.
scope.requestPipeline.intercept(HttpRequestPipeline.State) {
println("MyNewPlugin : works the scope ${context.method}")
context.header(HttpHeaders.UserAgent, feature.agent)
}
scope.responsePipeline.intercept(HttpRequestPipeline.State) {
println("MyNewPlugin : works the scope ${context.response.status}")
}
I wrote this in the install
function to test the Plugin for request and response pipeline but it crashes with this error
Caused by: io.ktor.util.pipeline.InvalidPhaseException: Phase Phase('State') was not registered for this pipeline
Aleksei Tirman [JB]
07/07/2021, 5:46 PMHttpResponsePipeline.State
instead of HttpRequestPipeline.State
because the response pipeline is intercepted.