Constructor and Description |
---|
HttpRequestOptions()
Constructs a set of HTTP request options with the default values.
|
HttpRequestOptions(HttpRequestOptions other)
Creates a new HttpRequestOptions object as a clone of the provided
parameter.
|
Modifier and Type | Method and Description |
---|---|
void |
addRequestHeader(String headerName,
String headerValue)
Adds a new HTTP request header.
|
boolean |
getAllowCircularRedirects() |
long |
getCacheTTLSeconds()
Gets the TTL for the cached response in seconds
|
int |
getConnTimeout()
Gets the HTTP connect timeout, in milliseconds.
|
String |
getContentType()
Gets the required content-type for the HTTP response.
|
static HttpRequestOptions |
getDefaultOptionsForDiscovery()
Returns an
HttpRequestOptions object suitable to use for
HTTP requests to perform discovery. |
static HttpRequestOptions |
getDefaultOptionsForOpCalls()
Returns an
HttpRequestOptions object suitable to use for
HTTP requests to OP endpoints for the purpose of creating associations
or verifying signatures. |
int |
getMaxBodySize()
Gets configuration parameter for the maximum HTTP body size
that will be downloaded.
|
int |
getMaxRedirects()
Gets the internal limit configured for the maximum number of redirects
to be followed for the HTTP calls.
|
Map |
getRequestHeaders()
Gets the HTTP request headers that will be used when placing
HTTP requests using the options in this object.
|
int |
getSocketTimeout()
Gets the HTTP socket (read) timeout, in milliseconds.
|
boolean |
isUseCache()
Returns true if a cached copy can be used when placing HTTP requests
using the options in this object.
|
void |
setAllowCircularRedirects(boolean allow) |
void |
setCacheTTLSeconds(long ttl)
Sets the TTL for the cached response in seconds
|
void |
setConnTimeout(int connTimeout)
Sets the HTTP connect timeout, in milliseconds.
|
void |
setContentType(String contentType)
Sets the required content-type for the HTTP response.
|
void |
setMaxBodySize(int maxBodySize)
Sets the maximum HTTP body size that will be downloaded.
|
void |
setMaxRedirects(int maxRedirects)
Sets the maximum number of redirects to be followed for the HTTP calls.
|
void |
setRequestHeaders(Map requestHeaders)
Sets the HTTP request headers that will be used when placing
HTTP requests using the options in this object.
|
void |
setSocketTimeout(int socketTimeout)
Sets HTTP socket (read) timeout, in milliseconds.
|
void |
setUseCache(boolean useCache)
Sets the flag for allowing cached copy to be used when placing
HTTP requests using the options in this object.
|
public HttpRequestOptions()
public HttpRequestOptions(HttpRequestOptions other)
other
- HttpRequestOptions instance to be cloned.public static HttpRequestOptions getDefaultOptionsForDiscovery()
HttpRequestOptions
object suitable to use for
HTTP requests to perform discovery.public static HttpRequestOptions getDefaultOptionsForOpCalls()
HttpRequestOptions
object suitable to use for
HTTP requests to OP endpoints for the purpose of creating associations
or verifying signatures.public int getConnTimeout()
public void setConnTimeout(int connTimeout)
public int getSocketTimeout()
public void setSocketTimeout(int socketTimeout)
public int getMaxRedirects()
public void setMaxRedirects(int maxRedirects)
public int getMaxBodySize()
public void setMaxBodySize(int maxBodySize)
public Map getRequestHeaders()
public void setRequestHeaders(Map requestHeaders)
public void addRequestHeader(String headerName, String headerValue)
public boolean isUseCache()
public void setUseCache(boolean useCache)
public String getContentType()
public void setContentType(String contentType)
public boolean getAllowCircularRedirects()
public void setAllowCircularRedirects(boolean allow)
public long getCacheTTLSeconds()
public void setCacheTTLSeconds(long ttl)
Copyright © 2017 Sxip. All rights reserved.