corda / net.corda.testing.http / HttpApi

HttpApi

class HttpApi

Constructors

<init>

HttpApi(root: URL, mapper: ObjectMapper = defaultMapper)

Properties

mapper

val mapper: ObjectMapper

root

val root: URL

Functions

getJson

fun <T : Any> getJson(path: String, params: Map<String, String> = mapOf()): T

Send a GET request to the path on the API specified.

postJson

fun postJson(path: String, data: Any = Unit): Unit

Send a POST with a payload to the path on the API specified.

postPlain

fun postPlain(path: String, data: String = ""): Unit

Send a POST with a payload to the path on the API specified.

putJson

fun putJson(path: String, data: Any = Unit): Unit

Send a PUT with a payload to the path on the API specified.

Companion Object Functions

fromHostAndPort

fun fromHostAndPort(hostAndPort: NetworkHostAndPort, base: String, protocol: String = "http", mapper: ObjectMapper = defaultMapper): HttpApi

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.