Hi all, i am little confused on the behaviour of `...
# ktor
l
Hi all, i am little confused on the behaviour of
RequestTimeout
in ktor-client. Docs says:
The request timeout is the time period required to process an HTTP call: from sending a request to receiving a response.
. Here, does receiving the response means receiving the headers and status code or receiving the full body as well ? In case it means receiving the full body as well, How does it work in case of streamed response bodies, as in if i have already received the
ByteReadChannel
via
HttpResponse.bodyAsChannel()
, and now i am reading the body and ingesting the data for the large content, by this time which method would throw the ex ? because
HttpClient.request
method would have already completed by this time as response is already obtained. I did found this thread, but due to my follow up, i was still confused. In all this i am assuming the actual response is buffered as i read from the channel and not brought in memory fully when i get the channel from response.
a
The request times out if the server fails to send back the status line and headers within the specified period. The timeout isn't concerned with the response body's receipt.
l
thanks for the clarification, i was assuming the same after going through the ktor client code, but above linked thread confused me a little.