public class HttpResponders
extends java.lang.Object
HttpStreams
Constructor and Description |
---|
HttpResponders() |
Modifier and Type | Method and Description |
---|---|
static <T> BiFunction<T,org.apache.http.client.methods.CloseableHttpResponse,T> |
inputOn(java.lang.Integer... codes)
Return the input tuple on specified codes.
|
static <T> BiFunction<T,org.apache.http.client.methods.CloseableHttpResponse,T> |
inputOn200()
Return the input tuple on OK.
|
static BiFunction<com.google.gson.JsonObject,org.apache.http.client.methods.CloseableHttpResponse,com.google.gson.JsonObject> |
json()
A HTTP response handler for
application/json . |
public static <T> BiFunction<T,org.apache.http.client.methods.CloseableHttpResponse,T> inputOn200()
T
- Type of input tuple.public static <T> BiFunction<T,org.apache.http.client.methods.CloseableHttpResponse,T> inputOn(java.lang.Integer... codes)
codes
, otherwise it returns the input tuple.
The HTTP entity in the response is consumed and discarded.T
- Type of input tuple.codes
- HTTP status codes to result in outputpublic static BiFunction<com.google.gson.JsonObject,org.apache.http.client.methods.CloseableHttpResponse,com.google.gson.JsonObject> json()
application/json
.
For each HTTP response a JSON object is produced that contains:
request
- the original input tuple that lead to the request response
- JSON object containing information about the response
status
- Status code for the response as an integerentity
- JSON response entity if one exists application/json
responses.Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641