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 void
close()
org.apache.http.HttpResponse
delete(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 void
finalize()
org.apache.http.HttpResponse
get(java.lang.String path)
<T> T
get(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)
void
getFile(java.lang.String path, java.io.File destination)
org.apache.http.HttpResponse
head(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.HttpResponse
patch(java.lang.String path, org.apache.http.entity.StringEntity entity)
PATCH requestsorg.apache.http.HttpResponse
post(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.HttpResponse
put(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 APIException
POST 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 APIException
PUT 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 APIException
DELETE 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 APIException
HEAD 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 APIException
PATCH requests- Throws:
APIException
-
finalize
protected void finalize() throws java.io.IOException
- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Throws:
java.io.IOException
-
-