public class HttpClient extends Object
| Constructor and Description |
|---|
HttpClient() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
CompletableFuture<byte[]> |
doAsyncRequest(String url,
io.netty.handler.codec.http.HttpMethod httpMethod,
byte[] body,
AuthenticationToken authToken) |
CompletableFuture<Void> |
doBulkRequest(String url,
io.netty.handler.codec.http.HttpMethod httpMethod,
byte[] body,
AuthenticationToken authToken,
BulkRestDataReceiver receiver)
Perform a request that potentially retrieves large amount of data.
|
CompletableFuture<Void> |
doBulkRequest(String url,
io.netty.handler.codec.http.HttpMethod httpMethod,
String body,
AuthenticationToken authToken,
BulkRestDataReceiver receiver) |
MediaType |
getAcceptMediaType() |
MediaType |
getSendMediaType() |
void |
setAcceptMediaType(MediaType acceptMediaType) |
void |
setMaxResponseLength(long length)
Sets the maximum size of the responses - this is not applicable to bulk requests whose response is practically unlimited and delivered piece by piece
|
void |
setSendMediaType(MediaType sendMediaType) |
public CompletableFuture<byte[]> doAsyncRequest(String url, io.netty.handler.codec.http.HttpMethod httpMethod, byte[] body, AuthenticationToken authToken) throws URISyntaxException
URISyntaxExceptionpublic void setMaxResponseLength(long length)
length - public CompletableFuture<Void> doBulkRequest(String url, io.netty.handler.codec.http.HttpMethod httpMethod, byte[] body, AuthenticationToken authToken, BulkRestDataReceiver receiver) throws URISyntaxException
url - httpMethod - body - authToken - receiver - - send all the data to this receiver. To find out when the request has been finished, the Future has to be usedURISyntaxExceptionpublic CompletableFuture<Void> doBulkRequest(String url, io.netty.handler.codec.http.HttpMethod httpMethod, String body, AuthenticationToken authToken, BulkRestDataReceiver receiver) throws URISyntaxException
URISyntaxExceptionpublic MediaType getSendMediaType()
public void setSendMediaType(MediaType sendMediaType)
public MediaType getAcceptMediaType()
public void setAcceptMediaType(MediaType acceptMediaType)
public void close()
Copyright © 2017 Space Applications Services. All rights reserved.