I am trying to setup a test with ktor if a request...
# ktor
a
I am trying to setup a test with ktor if a request take too long that it will fail, something like:
Copy code
withTimeout(timeMillis = 1000) {
    handleRequest(<http://HttpMethod.Post|HttpMethod.Post>, "/test") {
        addHeader(HttpHeaders.ContentType, ContentType.Application.Json.toString())
        setBody(requestMessage)
    }
}
But this will not working because
handleRequest
is not a
suspend
method. Why is that?