JdkRequestFactory

class JdkRequestFactory(baseURI: URITemplate, httpClient: HttpClient = defaultHttpClient(), val mediaTypeEncoders: MediaTypeEncoders = MediaTypeEncoders.default, val mediaTypeDecoders: MediaTypeDecoders = MediaTypeDecoders.default, requestTimeout: Duration = requestTimeoutDefault, eventRequestTimeout: Duration = EventSource.eventTimeoutDefault) : RequestFactory, Closeable

JDK11 HTTP Client implementation of RequestFactory.

Constructors

Link copied to clipboard
fun JdkRequestFactory(baseURI: URITemplate, httpClient: HttpClient = defaultHttpClient(), mediaTypeEncoders: MediaTypeEncoders = MediaTypeEncoders.default, mediaTypeDecoders: MediaTypeDecoders = MediaTypeDecoders.default, requestTimeout: Duration = requestTimeoutDefault, eventRequestTimeout: Duration = EventSource.eventTimeoutDefault)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun close()
open override fun close(cancelOutstandingRequests: Boolean)
Link copied to clipboard
fun eventSource(method: Method, pathTemplate: String, pathParameters: Parameters?, queryParameters: Parameters?, contentTypes: List<MediaType>?, acceptTypes: List<MediaType>?, headers: Parameters?): EventSource
fun <B : Any> eventSource(method: Method, pathTemplate: String, pathParameters: Parameters?, queryParameters: Parameters?, body: B?, contentTypes: List<MediaType>?, acceptTypes: List<MediaType>?, headers: Parameters?): EventSource
Link copied to clipboard
fun <D : Any> eventStream(method: Method, pathTemplate: String, pathParameters: Parameters?, queryParameters: Parameters?, contentTypes: List<MediaType>?, acceptTypes: List<MediaType>?, headers: Parameters?, decoder: (TextMediaTypeDecoder, String?, String?, String, Logger) -> D?): Flow<D>
fun <B : Any, D : Any> eventStream(method: Method, pathTemplate: String, pathParameters: Parameters?, queryParameters: Parameters?, body: B?, contentTypes: List<MediaType>?, acceptTypes: List<MediaType>?, headers: Parameters?, decoder: (TextMediaTypeDecoder, String?, String?, String, Logger) -> D?): Flow<D>
Link copied to clipboard
open override fun registerProblem(typeId: String, problemType: KClass<out ThrowableProblem>)
Link copied to clipboard
inline suspend fun request(method: Method, pathTemplate: String, pathParameters: Parameters?, queryParameters: Parameters?, contentTypes: List<MediaType>?, acceptTypes: List<MediaType>?, headers: Parameters?): Request
open suspend override fun <B : Any> request(method: Method, pathTemplate: String, pathParameters: Parameters?, queryParameters: Parameters?, body: B?, contentTypes: List<MediaType>?, acceptTypes: List<MediaType>?, headers: Parameters?, purpose: RequestFactory.RequestPurpose): Request
Link copied to clipboard
open suspend override fun response(request: Request): Response
inline suspend fun response(method: Method, pathTemplate: String, pathParameters: Parameters?, queryParameters: Parameters?, contentTypes: List<MediaType>?, acceptTypes: List<MediaType>?, headers: Parameters?): Response
inline suspend fun <B : Any> response(method: Method, pathTemplate: String, pathParameters: Parameters?, queryParameters: Parameters?, body: B?, contentTypes: List<MediaType>?, acceptTypes: List<MediaType>?, headers: Parameters?): Response
Link copied to clipboard
inline suspend fun <R : Any> result(method: Method, pathTemplate: String, pathParameters: Parameters?, queryParameters: Parameters?, contentTypes: List<MediaType>?, acceptTypes: List<MediaType>?, headers: Parameters?): R
inline suspend fun <B : Any, R : Any> result(method: Method, pathTemplate: String, pathParameters: Parameters?, queryParameters: Parameters?, body: B?, contentTypes: List<MediaType>?, acceptTypes: List<MediaType>?, headers: Parameters?): R
suspend fun <B : Any, R : Any> result(method: Method, pathTemplate: String, pathParameters: Parameters?, queryParameters: Parameters?, body: B?, contentTypes: List<MediaType>?, acceptTypes: List<MediaType>?, headers: Parameters?, resultType: KType): R
Link copied to clipboard
inline suspend fun <R : Any> resultResponse(method: Method, pathTemplate: String, pathParameters: Parameters?, queryParameters: Parameters?, contentTypes: List<MediaType>?, acceptTypes: List<MediaType>?, headers: Parameters?): ResultResponse<R>
inline suspend fun <B : Any, R : Any> resultResponse(method: Method, pathTemplate: String, pathParameters: Parameters?, queryParameters: Parameters?, body: B?, contentTypes: List<MediaType>?, acceptTypes: List<MediaType>?, headers: Parameters?): ResultResponse<R>
suspend fun <B : Any, R : Any> resultResponse(method: Method, pathTemplate: String, pathParameters: Parameters?, queryParameters: Parameters?, body: B?, contentTypes: List<MediaType>?, acceptTypes: List<MediaType>?, headers: Parameters?, resultType: KType): ResultResponse<R>

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val registeredProblemTypes: Map<String, KClass<out ThrowableProblem>>