Request

class Request(val method: Method, val url: String, options: RequestOptions.() -> Unit)

Class representing an HTTP request.

Constructors

Link copied to clipboard
constructor(method: Method, url: String, options: RequestOptions.() -> Unit)

Properties

Link copied to clipboard

The HTTP method to use for the request. This is an instance of the Method enum.

Link copied to clipboard

A lambda function with the request options. This object is used to specify the body, headers and other request parameters.

Link copied to clipboard
val url: String

The URL to which the request is to be sent.

Functions

Link copied to clipboard
suspend fun execute(): Response

Executes a synchronous HTTP request, downloading the entire response body at once.

Link copied to clipboard
suspend fun stream(callback: StreamCallback): Response

Executes a streaming HTTP request, downloading the response body in chunks.