toHttpRequestResult

fun Net.HttpResponse.toHttpRequestResult(requestData: Net.HttpRequest): HttpRequestResult

Converts this non thread-safe HttpResponse to HttpRequestResult that reads and caches the HTTP result content as byte array. Note that this method blocks the current thread until the HTTP result content is read.

Return

a new HttpRequestResult storing HttpResponse content.

Parameters

requestData

necessary to extract relevant data about the original request.