Package io.ktor.client.request
Types
abstract class ClientUpgradeContent : NoContent |
|
open class DefaultHttpRequest : HttpRequest Default HttpRequest implementation. |
|
interface HttpRequest : HttpMessage, CoroutineScope A request for HttpClient, first part of HttpClientCall. |
|
class HttpRequestBuilder : HttpMessageBuilder Class for building HttpRequestData. |
|
class HttpRequestData Actual data of the HttpRequest, including url, method, headers, body and executionContext. Built by HttpRequestBuilder. |
|
class HttpRequestPipeline : Pipeline<Any, HttpRequestBuilder> HttpClient Pipeline used for executing HttpRequest. |
|
class HttpResponseData Data prepared for HttpResponse. |
|
class HttpSendPipeline : Pipeline<Any, HttpRequestBuilder> HttpClient Pipeline used for sending HttpRequest to remote server. |
Properties
var HttpRequestBuilder.host: String Gets the associated URL’s host. |
|
var HttpRequestBuilder.port: Int Gets the associated URL’s port. |
Functions
fun HttpRequestBuilder.accept(contentType: ContentType): Unit Sets the |
|
fun HttpRequestBuilder.cookie( Sets a single header of key with a specific value if the value is not null. |
|
suspend fun <T> HttpClient.delete( Executes a HttpClient DELETE request, with the information from the builder and tries to receive a specific type T, if fails, an exception is thrown. suspend fun <T> HttpClient.delete( Executes a HttpClient DELETE request, with the specified scheme, host, port, path and body. And allows to further configure the request, using a block receiving an HttpRequestBuilder. suspend fun <T> HttpClient.delete( Executes a HttpClient DELETE request, with the specified url as URL and an optional block receiving an HttpRequestBuilder for further configuring the request. suspend fun <T> HttpClient.delete( Executes a HttpClient HEAD request, with the specified url as Url and an optional block receiving an HttpRequestBuilder for further configuring the request. suspend fun <T> HttpClient.delete( Executes a HttpClient HEAD request, with the specified url as URL and an optional block receiving an HttpRequestBuilder for further configuring the request. |
|
suspend fun <T> HttpClient.get( Executes a HttpClient GET request, with the information from the builder and tries to receive a specific type T, if fails, an exception is thrown. suspend fun <T> HttpClient.get( Executes a HttpClient GET request, with the specified scheme, host, port, path and body. And allows to further configure the request, using a block receiving an HttpRequestBuilder. suspend fun <T> HttpClient.get( suspend fun <T> HttpClient.get( Executes a HttpClient GET request, with the specified url as URL and an optional block receiving an HttpRequestBuilder for further configuring the request. suspend fun <T> HttpClient.get( Executes a HttpClient GET request, with the specified url as Url and an optional block receiving an HttpRequestBuilder for further configuring the request. |
|
suspend fun <T> HttpClient.head( Executes a HttpClient HEAD request, with the information from the builder and tries to receive a specific type T, if fails, an exception is thrown. suspend fun <T> HttpClient.head( Executes a HttpClient HEAD request, with the specified scheme, host, port, path and body. And allows to further configure the request, using a block receiving an HttpRequestBuilder. suspend fun <T> HttpClient.head( suspend fun <T> HttpClient.head( Executes a HttpClient HEAD request, with the specified url as URL and an optional block receiving an HttpRequestBuilder for further configuring the request. suspend fun <T> HttpClient.head( Executes a HttpClient HEAD request, with the specified url as Url and an optional block receiving an HttpRequestBuilder for further configuring the request. |
|
fun HttpRequestBuilder.header(key: String, value: Any?): Unit Sets a single header of key with a specific value if the value is not null. |
|
fun HttpRequestBuilder.headers( Executes a block that configures the HeadersBuilder associated to this request. |
|
fun HttpRequestData.isUpgradeRequest(): Boolean |
|
suspend fun <T> HttpClient.options( Executes a HttpClient OPTIONS request, with the information from the builder and tries to receive a specific type T, if fails, an exception is thrown. suspend fun <T> HttpClient.options( Executes a HttpClient OPTIONS request, with the specified scheme, host, port, path and body. And allows to further configure the request, using a block receiving an HttpRequestBuilder. suspend fun <T> HttpClient.options( suspend fun <T> HttpClient.options( Executes a HttpClient OPTIONS request, with the specified url as URL and an optional block receiving an HttpRequestBuilder for further configuring the request. suspend fun <T> HttpClient.options( Executes a HttpClient OPTIONS request, with the specified url as Url and an optional block receiving an HttpRequestBuilder for further configuring the request. |
|
fun HttpRequestBuilder.parameter( Sets a single URL query parameter of key with a specific value if the value is not null. Can not be used to set form parameters in the body. |
|
suspend fun <T> HttpClient.patch( Executes a HttpClient PATCH request, with the information from the builder and tries to receive a specific type T, if fails, an exception is thrown. suspend fun <T> HttpClient.patch( Executes a HttpClient PATCH request, with the specified scheme, host, port, path and body. And allows to further configure the request, using a block receiving an HttpRequestBuilder. suspend fun <T> HttpClient.patch( suspend fun <T> HttpClient.patch( Executes a HttpClient PATCH request, with the specified url as URL and an optional block receiving an HttpRequestBuilder for further configuring the request. suspend fun <T> HttpClient.patch( Executes a HttpClient PATCH request, with the specified url as Url and an optional block receiving an HttpRequestBuilder for further configuring the request. |
|
suspend fun <T> HttpClient.post( Executes a HttpClient POST request, with the information from the builder and tries to receive a specific type T, if fails, an exception is thrown. suspend fun <T> HttpClient.post( Executes a HttpClient POST request, with the specified scheme, host, port, path and body. And allows to further configure the request, using a block receiving an HttpRequestBuilder. suspend fun <T> HttpClient.post( suspend fun <T> HttpClient.post( Executes a HttpClient POST request, with the specified url as URL and an optional block receiving an HttpRequestBuilder for further configuring the request. suspend fun <T> HttpClient.post( Executes a HttpClient POST request, with the specified url as Url and an optional block receiving an HttpRequestBuilder for further configuring the request. |
|
suspend fun <T> HttpClient.put( Executes a HttpClient PUT request, with the information from the builder and tries to receive a specific type T, if fails, an exception is thrown. suspend fun <T> HttpClient.put( Executes a HttpClient PUT request, with the specified scheme, host, port, path and body. And allows to further configure the request, using a block receiving an HttpRequestBuilder. suspend fun <T> HttpClient.put( suspend fun <T> HttpClient.put( Executes a HttpClient PUT request, with the specified url as URL and an optional block receiving an HttpRequestBuilder for further configuring the request. suspend fun <T> HttpClient.put( Executes a HttpClient PUT request, with the specified url as Url and an optional block receiving an HttpRequestBuilder for further configuring the request. |
|
suspend fun <T> HttpClient.request( Executes a HttpClient request, with the information from the builder and tries to receive a specific type T, if fails, an exception is thrown. suspend fun <T> HttpClient.request( Executes a HttpClient request, with the information configured in builder block and tries to receive a specific type T, if fails, an exception is thrown. suspend fun <T> HttpClient.request( Executes a HttpClient request, with the urlString and the information configured in builder block and tries to receive a specific type T, if fails, an exception is thrown. suspend fun <T> HttpClient.request( Executes a HttpClient request, with the url and the information configured in builder block and tries to receive a specific type T, if fails, an exception is thrown. fun request( Creates a HttpRequestBuilder and configures it with a block of code. suspend fun <T> HttpClient.request( Executes a HttpClient request, with the specified url as URL and an optional block receiving an HttpRequestBuilder for further configuring the request. |
|
fun HttpRequestBuilder.takeFrom( Mutates this copying all the data from another request using it as base. fun HttpRequestBuilder.takeFrom( Sets the HttpRequestBuilder from request. |
|
fun HttpRequestBuilder.url( Executes a block that configures the URLBuilder associated to this request. fun HttpRequestBuilder.url( Sets the url using the specified scheme, host, port and path. fun HttpRequestBuilder.url(urlString: String): Unit Sets the HttpRequestBuilder.url from urlString. fun HttpRequestBuilder.url(url: Url): Unit fun HttpRequestBuilder.url(url: URL): URLBuilder Sets the HttpRequestBuilder.url from url. |
Companion Object Functions
operator fun HttpRequestBuilder.Companion.invoke( Executes a block that configures the URLBuilder associated to thisrequest. operator fun HttpRequestBuilder.Companion.invoke( Constructs a HttpRequestBuilder from URL information: scheme, host, port and path and optionally further configures it using block. operator fun HttpRequestBuilder.Companion.invoke( Constructs a HttpRequestBuilder from url. |