RemoteResourceRetrieverInput

data class RemoteResourceRetrieverInput(val url: String, val method: HttpMethod = HttpMethod.Get, val headers: Map<String, String> = emptyMap<String, String>(), val requestObjectParameters: RequestObjectParameters? = null)(source)

Fetch the url with the method, optionally sending requestObjectParameters or setting headers into HTTP request.

Example for ktor (data being this object):

client.submitForm(
url = data.url,
formParameters = parameters {
data.requestObjectParameters?.encodeToParameters()?.forEach { append(it.key, it.value) }
}
) {
data.headers.forEach { headers[it.key] = it.value }
}.bodyAsText()

or

client.get(URLBuilder(data.url).apply {
data.requestObjectParameters?.encodeToParameters()
?.forEach { parameters.append(it.key, it.value) }
}.build()) {
data.headers.forEach { headers[it.key] = it.value }
}.bodyAsText()

Constructors

Link copied to clipboard
constructor(url: String, method: HttpMethod = HttpMethod.Get, headers: Map<String, String> = emptyMap<String, String>(), requestObjectParameters: RequestObjectParameters? = null)

Properties

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