-
public class Request
-
-
Field Summary
Fields Modifier and Type Field Description public final static intTIMEOUT_NOT_SETprivate final Stringurlprivate final Array<byte>bodyprivate final Stringmethodprivate final Map<String, String>headersprivate final booleanisEncryptedprivate booleanreadResponseBodyprivate booleandisableCacheprivate booleanfollowRedirectsprivate inttimeoutMillis
-
Constructor Summary
Constructors Constructor Description Request(String url, Array<byte> body, String method, Map<String, String> headers, boolean shouldEncrypt)Request(String url, Array<byte> body, String method, Map<String, String> headers, boolean shouldEncrypt, boolean shouldPrintBody)Request(String url, String method, boolean shouldEncrypt)Creates request without headers and body
-
Method Summary
Modifier and Type Method Description StringgetUrl()Array<byte>getBody()StringgetMethod()Map<String, String>getHeaders()booleanisEncrypted()RequestsetReadResponseBody(boolean shouldReadResponseBody)RequestsetDisableCache(boolean disableCache)RequestsetFollowRedirects(boolean followRedirects)intgetTimeoutMillis()RequestsetTimeoutMillis(int timeoutMillis)booleanisReadResponseBody()Indicate whenever HTTP client should read the response body for this http requestSome request are not interested in response body, but just in response code.Skip reading body will save HTTP traffic, because HttpClient will download only status code and headers. booleanisDisableCache()Indicate if HttpUrlConnection should avoid use caches, effectively set Cache-Control headersee RD-48694 booleanshouldPrintBody()booleanisFollowRedirects()-
-
Method Detail
-
getHeaders
@NonNull() Map<String, String> getHeaders()
-
isEncrypted
boolean isEncrypted()
-
setReadResponseBody
Request setReadResponseBody(boolean shouldReadResponseBody)
-
setDisableCache
Request setDisableCache(boolean disableCache)
-
setFollowRedirects
Request setFollowRedirects(boolean followRedirects)
-
getTimeoutMillis
int getTimeoutMillis()
-
setTimeoutMillis
Request setTimeoutMillis(int timeoutMillis)
-
isReadResponseBody
boolean isReadResponseBody()
Indicate whenever HTTP client should read the response body for this http requestSome request are not interested in response body, but just in response code.Skip reading body will save HTTP traffic, because HttpClient will download only status code and headers.
-
isDisableCache
boolean isDisableCache()
Indicate if HttpUrlConnection should avoid use caches, effectively set Cache-Control headersee RD-48694
-
shouldPrintBody
boolean shouldPrintBody()
-
isFollowRedirects
boolean isFollowRedirects()
-
-
-
-