NetworkRequest

data class NetworkRequest(val url: String, val headers: Map<String, String> = emptyMap(), val method: NetworkRequest.Method = GET, val bodyBase64: String? = null)

A data class to represent a network request.

Parameters

url

The URL to make the request to

headers

The headers to be sent with the request

method

The HTTP method to use for the request, defaults to Method.GET

bodyBase64

The body of the request encoded in Base64, can be null

See also

Constructors

Link copied to clipboard
constructor(method: NetworkRequest.Method, url: String, headers: Map<String, String> = emptyMap(), body: ByteArray? = null)
constructor(url: String, headers: Map<String, String> = emptyMap(), method: NetworkRequest.Method = GET, bodyBase64: String? = null)

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Represents the HTTP methods that can be used in a network request.

Properties

Link copied to clipboard
val body: <Error class: unknown class>

The body of the request decoded from Base64. If bodyBase64 is null, this will also be null.

Link copied to clipboard
val bodyBase64: String? = null
Link copied to clipboard
Link copied to clipboard
val lowerCaseHeaders: <Error class: unknown class>

A map of headers with all keys converted to lowercase. This is useful for case-insensitive header lookups.

Link copied to clipboard
Link copied to clipboard
val url: String