public interface BlockingHttpClient
extends java.io.Closeable
HttpClient and
is designed primarily for testing purposes.| Modifier and Type | Method and Description |
|---|---|
default <I,O> HttpResponse<O> |
exchange(HttpRequest<I> request)
Perform an HTTP request for the given request object emitting the full HTTP response from returned
Publisher. |
default <I,O> 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> 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> 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 <O> HttpResponse<O> |
exchange(java.lang.String uri)
Perform a GET request for the given request object emitting the full HTTP response from returned
Publisher. |
default <O> HttpResponse<O> |
exchange(java.lang.String uri,
java.lang.Class<O> bodyType)
Perform a GET request for the given request object emitting the full HTTP response from returned
Publisher. |
default <O,E> HttpResponse<O> |
exchange(java.lang.String uri,
java.lang.Class<O> bodyType,
java.lang.Class<E> errorType)
Perform a GET request for the given request object emitting the full HTTP response from returned
Publisher. |
default <I> 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> 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> 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> 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 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. |
default <O> O |
retrieve(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 and converting the response body to the specified type. |
default <O,E> O |
retrieve(java.lang.String uri,
java.lang.Class<O> bodyType,
java.lang.Class<E> errorType)
Perform a GET request for the given request object emitting the full HTTP response from returned
Publisher. |
<I,O,E> 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.
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
I - The request body typeO - The response body typeE - The error typerequest - The HttpRequest to executebodyType - The body typeerrorType - The error typeHttpResponse objectHttpClientResponseException - when an error status is returneddefault <I,O> 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.
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
I - The request body typeO - The response body typerequest - The HttpRequest to executebodyType - The body typeHttpResponse objectHttpClientResponseException - when an error status is returneddefault <I,O> HttpResponse<O> exchange(HttpRequest<I> request)
Publisher.I - The request body typeO - The response body typerequest - The HttpRequest to executeHttpResponse objectHttpClientResponseException - when an error status is returneddefault <I,O> HttpResponse<O> exchange(HttpRequest<I> request, java.lang.Class<O> bodyType)
Publisher and converting the response body to the specified type.I - The request body typeO - The response body typerequest - The HttpRequest to executebodyType - The body typeHttpResponse objectHttpClientResponseException - when an error status is returneddefault <I,O> O retrieve(HttpRequest<I> request, Argument<O> bodyType)
Publisher and converting the response body to the specified type.I - The request body typeO - The response body typerequest - The HttpRequest to executebodyType - The body typeHttpClientResponseException - when an error status is returneddefault <I,O,E> O retrieve(HttpRequest<I> request, Argument<O> bodyType, Argument<E> errorType)
Publisher and converting the response body to the specified type.I - The request body typeO - The response body typeE - The error typerequest - The HttpRequest to executebodyType - The body typeerrorType - The error typeHttpClientResponseException - when an error status is returneddefault <I,O> O retrieve(HttpRequest<I> request, java.lang.Class<O> bodyType)
Publisher and converting the response body to the specified type.I - The request body typeO - The response body typerequest - The HttpRequest to executebodyType - The body typeHttpClientResponseException - when an error status is returneddefault <I> java.lang.String retrieve(HttpRequest<I> request)
Publisher and converting the response body to the specified type.I - The request body typerequest - The HttpRequest to executeHttpClientResponseException - when an error status is returneddefault java.lang.String retrieve(java.lang.String uri)
Publisher and converting the response body to the specified type.uri - The URIHttpClientResponseException - when an error status is returneddefault <O> O retrieve(java.lang.String uri,
java.lang.Class<O> bodyType)
Publisher and converting the response body to the specified type.O - The body generic typeuri - The URIbodyType - The body typeHttpClientResponseException - when an error status is returneddefault <O,E> O retrieve(java.lang.String uri,
java.lang.Class<O> bodyType,
java.lang.Class<E> errorType)
Publisher.O - The response body typeE - The error typeuri - The URI of the GET requestbodyType - The body typeerrorType - The error typeHttpResponse objectHttpClientResponseException - when an error status is returneddefault <O> HttpResponse<O> exchange(java.lang.String uri)
Publisher.O - The response body typeuri - The URI of the GET requestHttpResponse objectHttpClientResponseException - when an error status is returneddefault <O> HttpResponse<O> exchange(java.lang.String uri, java.lang.Class<O> bodyType)
Publisher.O - The response body typeuri - The URI of the GET requestbodyType - The body typeHttpResponse objectHttpClientResponseException - when an error status is returneddefault <O,E> HttpResponse<O> exchange(java.lang.String uri, java.lang.Class<O> bodyType, java.lang.Class<E> errorType)
Publisher.O - The response body typeE - The error typeuri - The URI of the GET requestbodyType - The body typeerrorType - The error typeHttpResponse objectHttpClientResponseException - when an error status is returned