Package-level declarations

Properties

Link copied to clipboard
val <B : Any> HttpMessage<B>.bodyOrNull: B?

Extension property to retrieve the body of the HttpMessage as a nullable object instead of an Optional. Allowing to write message.bodyOrNull instead of message.body.getOrNull().

Functions

Link copied to clipboard
inline fun <T : Any> argumentOf(): Argument<T>

Shortcut to create an argument of the given type

Link copied to clipboard
inline fun <T : Any> argumentOfList(): Argument<List<T>>

Shortcut to create an argument of a list the given type

Link copied to clipboard
inline fun <T : Any> BlockingHttpClient.exchangeList(request: HttpRequest<Any>): HttpResponse<List<T>>

Perform an HTTP request for the given request object emitting the full HTTP response from returned org.reactivestreams.Publisher and converting the response body to a list of the specified type. Allowing for client.exchangeList<Hero>(HttpRequest.GET("/heroes/any")) instead of client.exchange(HttpRequest.GET<Any>("/heroes/any"), Argument.listOf(Hero::class.java)).

Link copied to clipboard
inline fun <T : Any> BlockingHttpClient.exchangeObject(request: HttpRequest<Any>): HttpResponse<T>

Perform an HTTP request for the given request object emitting the full HTTP response from returned org.reactivestreams.Publisher and converting the response body to the specified type. Allowing for client.exchangeObject<Hero>(HttpRequest.GET("/heroes/any")) instead of client.exchange(HttpRequest.GET<Any>("/heroes/any"), Argument.of(Hero::class.java)).

Link copied to clipboard
inline fun <T : Any> HttpMessage<*>.getBodyObject(): T?

Retrieve the body of the message as an object of the given type. Allowing to write message.getBodyObject<Foo>() instead of message.getBody(Argument.of(Foo::class.java)).getOrNull() or message.getBody(Foo::class.java)).getOrNull().

Link copied to clipboard
inline fun <T : Any> BlockingHttpClient.retrieveList(request: HttpRequest<Any>): List<T>

Perform an HTTP request for the given request object emitting the full HTTP response from returned Publisher and converting the response body to a list of the specified type. Allows for client.retrieveList<Hero>(HttpRequest.GET("/heroes/any")) instead of client.retrieve(HttpRequest.GET<Any>("/heroes/any"), Argument.listOf(Hero::class.java)).

Link copied to clipboard
inline fun <T : Any> BlockingHttpClient.retrieveObject(request: HttpRequest<Any>): T

Perform an HTTP request for the given request object emitting the full HTTP response from returned Publisher and converting the response body to the specified type. Allows for client.retrieveObject<Hero>(HttpRequest.GET("/heroes/any")) instead of client.retrieve(HttpRequest.GET<Any>("/heroes/any"), Argument.of(Hero::class.java)).