public class HttpClient extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
MT_PROTOBUF |
| Constructor and Description |
|---|
HttpClient() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCookie(io.netty.handler.codec.http.cookie.Cookie c) |
void |
close() |
CompletableFuture<byte[]> |
doAsyncRequest(String url,
io.netty.handler.codec.http.HttpMethod httpMethod,
byte[] body) |
CompletableFuture<byte[]> |
doAsyncRequest(String url,
io.netty.handler.codec.http.HttpMethod httpMethod,
byte[] body,
io.netty.handler.codec.http.HttpHeaders extraHeaders) |
CompletableFuture<Void> |
doBulkReceiveRequest(String url,
io.netty.handler.codec.http.HttpMethod httpMethod,
byte[] body,
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,
BulkRestDataReceiver receiver) |
CompletableFuture<BulkRestDataSender> |
doBulkSendRequest(String url,
io.netty.handler.codec.http.HttpMethod httpMethod) |
String |
getAcceptMediaType() |
List<io.netty.handler.codec.http.cookie.Cookie> |
getCookies() |
Credentials |
getCredentials() |
String |
getSendMediaType() |
boolean |
isInsecureTls() |
void |
login(String tokenUrl,
String username,
char[] password) |
void |
loginWithAuthorizationCode(String tokenUrl,
String authorizationCode) |
void |
refreshAccessToken() |
void |
setAcceptMediaType(String acceptMediaType) |
void |
setCaCertFile(String caCertFile)
In case of https connections, this file contains the CA certificates that are used to verify server certificate
|
void |
setInsecureTls(boolean insecureTls)
if true and https connections are used, do not verify server certificate
|
void |
setMaxResponseLength(int 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(String sendMediaType) |
public static final String MT_PROTOBUF
public void login(String tokenUrl, String username, char[] password) throws ClientException
ClientExceptionpublic void loginWithAuthorizationCode(String tokenUrl, String authorizationCode) throws ClientException
ClientExceptionpublic void refreshAccessToken()
throws ClientException
ClientExceptionpublic Credentials getCredentials()
public CompletableFuture<byte[]> doAsyncRequest(String url, io.netty.handler.codec.http.HttpMethod httpMethod, byte[] body) throws ClientException, IOException, GeneralSecurityException
public CompletableFuture<byte[]> doAsyncRequest(String url, io.netty.handler.codec.http.HttpMethod httpMethod, byte[] body, io.netty.handler.codec.http.HttpHeaders extraHeaders) throws ClientException, IOException, GeneralSecurityException
public CompletableFuture<BulkRestDataSender> doBulkSendRequest(String url, io.netty.handler.codec.http.HttpMethod httpMethod) throws ClientException, IOException, GeneralSecurityException
public void setMaxResponseLength(int length)
length - public CompletableFuture<Void> doBulkReceiveRequest(String url, io.netty.handler.codec.http.HttpMethod httpMethod, byte[] body, BulkRestDataReceiver receiver) throws ClientException, IOException, GeneralSecurityException
receiver - send all the data to this receiver. To find out when the request has been finished, the Future has to
be usedGeneralSecurityExceptionIOExceptionClientExceptionpublic CompletableFuture<Void> doBulkRequest(String url, io.netty.handler.codec.http.HttpMethod httpMethod, String body, BulkRestDataReceiver receiver) throws ClientException, IOException, GeneralSecurityException
public void setCaCertFile(String caCertFile) throws IOException, GeneralSecurityException
caCertFile - IOExceptionGeneralSecurityExceptionpublic boolean isInsecureTls()
public void setInsecureTls(boolean insecureTls)
insecureTls - public void addCookie(io.netty.handler.codec.http.cookie.Cookie c)
public List<io.netty.handler.codec.http.cookie.Cookie> getCookies()
public String getSendMediaType()
public void setSendMediaType(String sendMediaType)
public String getAcceptMediaType()
public void setAcceptMediaType(String acceptMediaType)
public void close()
Copyright © 2022 Space Applications Services. All rights reserved.