HttpResponse
An HttpClient's response, a second part of HttpClientCall.
Learn more from Receiving responses.
Constructors
Functions
Properties
The associated HttpClientCall containing both the underlying HttpClientCall.request and HttpClientCall.response.
Unmodified ByteReadChannel with the raw payload of the response.
The HttpStatusCode returned by the server. It includes both, the HttpStatusCode.description and the HttpStatusCode.value (code).
HTTP version. Usually HttpProtocolVersion.HTTP_1_1 or HttpProtocolVersion.HTTP_2_0.
Inheritors
Extensions
Reads the HttpResponse.content as a ByteReadChannel.
Reads the HttpResponse.content as a String. You can pass an optional charset to specify a charset in the case no one is specified as part of the Content-Type
response. If no charset specified either as parameter or as part of the response, io.ktor.client.plugins.HttpPlainText settings will be used.
Efficiently discards the remaining bytes of HttpResponse.content.
Returns ByteReadChannel with ByteChannel.close handler that returns SocketTimeoutException instead of SocketTimeoutException.
Returns ByteWriteChannel with ByteChannel.close handler that returns SocketTimeoutException instead of SocketTimeoutException.
Reads exactly count bytes of the HttpResponse.content.
Reads the whole HttpResponse.content if Content-Length
is specified. Otherwise, it just reads one byte.
Read the HttpResponse.content as a String. You can pass an optional charset to specify a charset in the case no one is specified as part of the Content-Type response. If no charset specified either as parameter or as part of the response, io.ktor.client.plugins.HttpPlainText settings will be used.
Gets HttpRequest associated with this response.