RestApiRequest

@Serializable
data class RestApiRequest(val protocol: Protocol = Protocol.HTTP, val baseUrl: String, val method: Method = Method.GET, val headers: Map<String, String> = mapOf("content-type" to "application/json"), val body: Body = Body.EmptyBody, val timeout: Long = 2000) : Action

Data class representing a REST API request action.

Constructors

Link copied to clipboard
constructor(protocol: Protocol = Protocol.HTTP, baseUrl: String, method: Method = Method.GET, headers: Map<String, String> = mapOf("content-type" to "application/json"), body: Body = Body.EmptyBody, timeout: Long = 2000)

Properties

Link copied to clipboard

The base URL for the request.

Link copied to clipboard
val body: Body

The body of the request (default is an empty body).

Link copied to clipboard

The headers to be included in the request (default is content-type: application/json).

Link copied to clipboard

The HTTP method to be used for the request (default is GET).

Link copied to clipboard

The protocol to be used for the request (default is HTTP).

Link copied to clipboard
val timeout: Long = 2000

The timeout for the request in milliseconds (default is 2000ms).