com.miracl.miracltrust.network

Types

ApiRequest

data class ApiRequest

MiraclApiRequest is a data class that keeps the main properties of a HTTP request.

Constructors

MiraclApiRequest is a data class that keeps the main properties of a HTTP request.

ApiRequest(method: HttpMethod, headers: Map<String, String>?, body: String?, params: Map<String, String>?, url: String)

Properties
body

val body: String?

headers

val headers: Map<String, String>?

method

val method: HttpMethod

params

val params: Map<String, String>?

url

val url: String

Enums

HttpMethod

enum class HttpMethod

HttpMethod is a MIRACLTrust SDK representation of the HTTP methods

Properties

method

val method: String

Interfaces

HttpRequestExecutor

interface HttpRequestExecutor

HttpRequestExecutor is an interface providing pluggable networking layer of the MIRACLTrust SDK. If implemented and passed as an argument when initializing the MIRACLTrust SDK, you can provide your own HTTP request executor.

Functions

execute

Executes HTTP requests.

abstract suspend fun execute(apiRequest: ApiRequest): MiraclResult<String, Error>

Parameters

apiRequest - provides the required information for processing the HTTP request.

Return MiraclResult<String, Error> which can be either MiraclSuccess with value of type String (the response of the executed request) or MiraclError with value of type java.lang.Error with a message.