RestCaller
, RestCallerBuilder
RestCallerBuilderImpl
@FunctionalInterface public interface RestResponseObserver
RestResponseObserver
can be coded using the lambda
syntax and processes a response from a server. The RestResponseEvent
describes the context of the response e.g. retrieve the server's response via
HttpClientResponse.getResponse(Class)
or the response's HTTP
Status-Code via HttpStatusCodeAccessor.getHttpStatusCode()
.Modifier and Type | Method | Description |
---|---|---|
void |
onResponse(RestResponseEvent aResponse) |
The invoker provides a response context being a
RestResponseEvent
describing the response being processed upon by your
lambda 's code. |
void onResponse(RestResponseEvent aResponse) throws org.refcodes.net.HttpResponseException
RestResponseEvent
describing the response being processed upon by your
lambda
's code. The method works synchronously and waits
(blocks the caller's thread) till it finishes execution.aResponse
- The response of type RestResponseEvent
describing the response context. Use
HttpClientResponse.getResponse(Class)
to retrieve the
server's response body or
HttpStatusCodeAccessor.getHttpStatusCode()
to retrieve the
respone's HTTP Status-Code.org.refcodes.net.HttpResponseException
- thrown by a HTTP-Response handling system
in case of some unexpected response.Copyright © 2018. All rights reserved.