Package com.algorithmia.client
Class HttpClient
- java.lang.Object
-
- com.algorithmia.client.HttpClient
-
public class HttpClient extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description HttpClient(Auth auth, java.lang.String apiAddress, int maxConnections)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()org.apache.http.HttpResponsedelete(java.lang.String path)DELETE requests<T> java.util.concurrent.Future<T>delete(java.lang.String path, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> consumer)protected voidfinalize()org.apache.http.HttpResponseget(java.lang.String path)<T> Tget(java.lang.String path, com.google.gson.reflect.TypeToken<T> typeToken, java.util.Map<java.lang.String,java.lang.String> params)<T> java.util.concurrent.Future<T>get(java.lang.String path, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> consumer)voidgetFile(java.lang.String path, java.io.File destination)org.apache.http.HttpResponsehead(java.lang.String path)HEAD requests<T> java.util.concurrent.Future<T>head(java.lang.String path, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> consumer)org.apache.http.HttpResponsepatch(java.lang.String path, org.apache.http.entity.StringEntity entity)PATCH requestsorg.apache.http.HttpResponsepost(java.lang.String path, org.apache.http.HttpEntity data)POST requests<T> java.util.concurrent.Future<T>post(java.lang.String path, org.apache.http.HttpEntity data, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> consumer)<T> java.util.concurrent.Future<T>post(java.lang.String path, org.apache.http.HttpEntity data, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> consumer, java.util.Map<java.lang.String,java.lang.String> parameters)org.apache.http.HttpResponseput(java.lang.String path, org.apache.http.HttpEntity data)PUT requests<T> java.util.concurrent.Future<T>put(java.lang.String path, org.apache.http.HttpEntity data, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> consumer)
-
-
-
Constructor Detail
-
HttpClient
public HttpClient(Auth auth, java.lang.String apiAddress, int maxConnections)
-
-
Method Detail
-
get
public org.apache.http.HttpResponse get(java.lang.String path) throws APIException- Throws:
APIException
-
get
public <T> T get(java.lang.String path, com.google.gson.reflect.TypeToken<T> typeToken, java.util.Map<java.lang.String,java.lang.String> params) throws APIException- Throws:
APIException
-
get
public <T> java.util.concurrent.Future<T> get(java.lang.String path, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> consumer)
-
getFile
public void getFile(java.lang.String path, java.io.File destination) throws APIException- Throws:
APIException
-
post
public org.apache.http.HttpResponse post(java.lang.String path, org.apache.http.HttpEntity data) throws APIExceptionPOST requests- Throws:
APIException
-
post
public <T> java.util.concurrent.Future<T> post(java.lang.String path, org.apache.http.HttpEntity data, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> consumer)
-
post
public <T> java.util.concurrent.Future<T> post(java.lang.String path, org.apache.http.HttpEntity data, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> consumer, java.util.Map<java.lang.String,java.lang.String> parameters)
-
put
public org.apache.http.HttpResponse put(java.lang.String path, org.apache.http.HttpEntity data) throws APIExceptionPUT requests- Throws:
APIException
-
put
public <T> java.util.concurrent.Future<T> put(java.lang.String path, org.apache.http.HttpEntity data, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> consumer)
-
delete
public org.apache.http.HttpResponse delete(java.lang.String path) throws APIExceptionDELETE requests- Throws:
APIException
-
delete
public <T> java.util.concurrent.Future<T> delete(java.lang.String path, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> consumer)
-
head
public org.apache.http.HttpResponse head(java.lang.String path) throws APIExceptionHEAD requests- Throws:
APIException
-
head
public <T> java.util.concurrent.Future<T> head(java.lang.String path, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> consumer)
-
patch
public org.apache.http.HttpResponse patch(java.lang.String path, org.apache.http.entity.StringEntity entity) throws APIExceptionPATCH requests- Throws:
APIException
-
finalize
protected void finalize() throws java.io.IOException- Overrides:
finalizein classjava.lang.Object- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Throws:
java.io.IOException
-
-