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

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

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

postJson

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

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

postPlain

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

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

putJson

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

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

Companion Object Functions

fromHostAndPort

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