sendOhttpRequest

suspend fun sendOhttpRequest(request: Request, channel: String): Response

Send a request through an OHTTP channel.

This encrypts the request and routes it through the configured OHTTP relay/gateway for the specified channel.

Arguments

  • request - The request to send

  • channel - The name of the OHTTP channel to use (e.g., "merino")

Example (Kotlin)

val response = sendOhttpRequest(
Request(
method = Method.GET,
url = "https://example.com/api",
headers = mapOf("Accept" to "application/json"),
body = null
),
"merino"
)