Package com.algorithmia.client
Class HttpClientHelpers
- java.lang.Object
-
- com.algorithmia.client.HttpClientHelpers
-
public class HttpClientHelpers extends java.lang.Object
Various HTTP actions, using our HttpClient class, and automatically adding authorization
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpClientHelpers.AbstractBasicResponseConsumer<T>
static class
HttpClientHelpers.AlgoResponseHandler
static class
HttpClientHelpers.JsonDeserializeResponseHandler<T>
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AlgoResponse
jsonToAlgoResponse(com.google.gson.JsonElement json, Algorithm.AlgorithmOutputType outputType)
static com.google.gson.JsonElement
parseResponseJson(org.apache.http.HttpResponse response)
static void
throwIfJsonHasError(com.google.gson.JsonElement json)
static void
throwIfNotOk(org.apache.http.HttpResponse response)
-
-
-
Method Detail
-
jsonToAlgoResponse
public static AlgoResponse jsonToAlgoResponse(com.google.gson.JsonElement json, Algorithm.AlgorithmOutputType outputType) throws APIException
- Throws:
APIException
-
throwIfNotOk
public static void throwIfNotOk(org.apache.http.HttpResponse response) throws APIException
- Throws:
APIException
-
throwIfJsonHasError
public static void throwIfJsonHasError(com.google.gson.JsonElement json) throws APIException
- Throws:
APIException
-
parseResponseJson
public static com.google.gson.JsonElement parseResponseJson(org.apache.http.HttpResponse response) throws APIException
- Throws:
APIException
-
-