Package com.algorithmia.client
Class HttpClientHelpers
- java.lang.Object
-
- com.algorithmia.client.HttpClientHelpers
-
public class HttpClientHelpers extends java.lang.ObjectVarious HTTP actions, using our HttpClient class, and automatically adding authorization
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHttpClientHelpers.AbstractBasicResponseConsumer<T>static classHttpClientHelpers.AlgoResponseHandlerstatic classHttpClientHelpers.JsonDeserializeResponseHandler<T>
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AlgoResponsejsonToAlgoResponse(com.google.gson.JsonElement json, Algorithm.AlgorithmOutputType outputType)static com.google.gson.JsonElementparseResponseJson(org.apache.http.HttpResponse response)static voidthrowIfJsonHasError(com.google.gson.JsonElement json)static voidthrowIfNotOk(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
-
-