public interface RxHttpClient extends HttpClient
HttpClient
that exposes an RxJava 2.x specific interface.DEFAULT_ERROR_TYPE
Modifier and Type | Method and Description |
---|---|
static RxHttpClient |
create(java.net.URL url)
Create a new
HttpClient . |
default <I> io.reactivex.Flowable<HttpResponse<ByteBuffer>> |
exchange(HttpRequest<I> request)
Perform an HTTP request for the given request object emitting the full HTTP response from returned
Publisher . |
default <I,O> io.reactivex.Flowable<HttpResponse<O>> |
exchange(HttpRequest<I> request,
Argument<O> bodyType)
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. |
<I,O,E> io.reactivex.Flowable<HttpResponse<O>> |
exchange(HttpRequest<I> request,
Argument<O> bodyType,
Argument<E> errorType)
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. |
default <I,O> io.reactivex.Flowable<HttpResponse<O>> |
exchange(HttpRequest<I> request,
java.lang.Class<O> bodyType)
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. |
default io.reactivex.Flowable<HttpResponse<ByteBuffer>> |
exchange(java.lang.String uri)
Perform an HTTP GET request for the given request object emitting the full HTTP response from returned
Publisher . |
default <O> io.reactivex.Flowable<HttpResponse<O>> |
exchange(java.lang.String uri,
java.lang.Class<O> bodyType)
Perform an HTTP GET request for the given request object emitting the full HTTP response from returned
Publisher . |
default <I> io.reactivex.Flowable<java.lang.String> |
retrieve(HttpRequest<I> request)
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. |
default <I,O> io.reactivex.Flowable<O> |
retrieve(HttpRequest<I> request,
Argument<O> bodyType)
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. |
default <I,O,E> io.reactivex.Flowable<O> |
retrieve(HttpRequest<I> request,
Argument<O> bodyType,
Argument<E> errorType)
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. |
default <I,O> io.reactivex.Flowable<O> |
retrieve(HttpRequest<I> request,
java.lang.Class<O> bodyType)
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. |
default io.reactivex.Flowable<java.lang.String> |
retrieve(java.lang.String uri)
Perform an HTTP GET request for the given request object emitting the full HTTP response from returned
Publisher and converting the response body to the specified type. |
refresh, toBlocking
default <I,O> io.reactivex.Flowable<HttpResponse<O>> exchange(HttpRequest<I> request, Argument<O> bodyType)
HttpClient
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.
This method will send a Content-Length
header and except a content length header the response and is
designed for simple non-streaming exchanges of data
By default the exchange Content-Type
is application/json, unless otherwise specified in the passed
HttpRequest
exchange
in interface HttpClient
I
- The request body typeO
- The response body typerequest
- The HttpRequest
to executebodyType
- The body typePublisher
that emits the full HttpResponse
object<I,O,E> io.reactivex.Flowable<HttpResponse<O>> exchange(HttpRequest<I> request, Argument<O> bodyType, Argument<E> errorType)
HttpClient
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.
This method will send a Content-Length
header and except a content length header the response and is
designed for simple non-streaming exchanges of data
By default the exchange Content-Type
is application/json, unless otherwise specified in the passed
HttpRequest
exchange
in interface HttpClient
I
- The request body typeO
- The response body typeE
- The error typerequest
- The HttpRequest
to executebodyType
- The body typeerrorType
- The error typePublisher
that emits the full HttpResponse
objectdefault <I,O,E> io.reactivex.Flowable<O> retrieve(HttpRequest<I> request, Argument<O> bodyType, Argument<E> errorType)
HttpClient
Publisher
and converting the response body to the specified type.retrieve
in interface HttpClient
I
- The request body typeO
- The response body typeE
- The error typerequest
- The HttpRequest
to executebodyType
- The body typeerrorType
- The error typePublisher
that emits a result of the given typedefault <I> io.reactivex.Flowable<HttpResponse<ByteBuffer>> exchange(HttpRequest<I> request)
HttpClient
Publisher
.exchange
in interface HttpClient
I
- The request body typerequest
- The HttpRequest
to executePublisher
that emits the full HttpResponse
objectdefault io.reactivex.Flowable<HttpResponse<ByteBuffer>> exchange(java.lang.String uri)
HttpClient
Publisher
.exchange
in interface HttpClient
uri
- The UriPublisher
that emits the full HttpResponse
objectdefault <O> io.reactivex.Flowable<HttpResponse<O>> exchange(java.lang.String uri, java.lang.Class<O> bodyType)
HttpClient
Publisher
.exchange
in interface HttpClient
O
- The response body typeuri
- The request URIbodyType
- The body typePublisher
that emits the full HttpResponse
objectdefault <I,O> io.reactivex.Flowable<HttpResponse<O>> exchange(HttpRequest<I> request, java.lang.Class<O> bodyType)
HttpClient
Publisher
and converting the response body to the specified type.exchange
in interface HttpClient
I
- The request body typeO
- The response body typerequest
- The HttpRequest
to executebodyType
- The body typePublisher
that emits the full HttpResponse
objectdefault <I,O> io.reactivex.Flowable<O> retrieve(HttpRequest<I> request, Argument<O> bodyType)
HttpClient
Publisher
and converting the response body to the specified type.retrieve
in interface HttpClient
I
- The request body typeO
- The response body typerequest
- The HttpRequest
to executebodyType
- The body typePublisher
that emits a result of the given typedefault <I,O> io.reactivex.Flowable<O> retrieve(HttpRequest<I> request, java.lang.Class<O> bodyType)
HttpClient
Publisher
and converting the response body to the specified type.retrieve
in interface HttpClient
I
- The request body typeO
- The response body typerequest
- The HttpRequest
to executebodyType
- The body typePublisher
that emits a result of the given typedefault <I> io.reactivex.Flowable<java.lang.String> retrieve(HttpRequest<I> request)
HttpClient
Publisher
and converting the response body to the specified type.retrieve
in interface HttpClient
I
- The request body typerequest
- The HttpRequest
to executePublisher
that emits String resultdefault io.reactivex.Flowable<java.lang.String> retrieve(java.lang.String uri)
HttpClient
Publisher
and converting the response body to the specified type.retrieve
in interface HttpClient
uri
- The URIPublisher
that emits String resultstatic RxHttpClient create(@Nullable java.net.URL url)
HttpClient
. Note that this method should only be used outside of the context of an application. Within Micronaut use
Inject
to inject a client insteadcreate
in interface HttpClient
url
- The base URL