Interface RestResponseConsumer
- All Known Implementing Classes:
RestResponseHandler,RestResponseResult
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
The
RestResponseConsumer 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 AbstractHttpResponse.getHttpStatusCode().-
Method Summary
Modifier and TypeMethodDescriptionvoidonResponse(RestResponseEvent aResponse) The invoker provides a response context being aRestResponseEventdescribing the response being processed upon by yourlambda's code.
-
Method Details
-
onResponse
The invoker provides a response context being aRestResponseEventdescribing the response being processed upon by yourlambda's code. The method works synchronously and waits (blocks the caller's thread) till it finishes execution.- Parameters:
aResponse- The response of typeRestResponseEventdescribing the response context. UseHttpClientResponse.getResponse(Class)to retrieve the server's response body orAbstractHttpResponse.getHttpStatusCode()to retrieve the respone's HTTP Status-Code.- Throws:
org.refcodes.web.HttpResponseException- thrown by a HTTP-Response handling system in case of some unexpected response.
-