public static interface Connection.Request extends Connection.Base<Connection.Request>
Modifier and Type | Method and Description |
---|---|
Collection<Connection.KeyVal> |
data()
Get all of the request's data parameters
|
Connection.Request |
data(Connection.KeyVal keyval)
Add a data parameter to the request
|
boolean |
followRedirects()
Get the current followRedirects configuration.
|
Connection.Request |
followRedirects(boolean followRedirects)
Configures the request to (not) follow server redirects.
|
boolean |
ignoreContentType()
Get the current ignoreContentType configuration.
|
Connection.Request |
ignoreContentType(boolean ignoreContentType)
Configures the request to ignore the Content-Type of the response.
|
boolean |
ignoreHttpErrors()
Get the current ignoreHttpErrors configuration.
|
Connection.Request |
ignoreHttpErrors(boolean ignoreHttpErrors)
Configures the request to ignore HTTP errors in the response.
|
int |
maxBodySize()
Get the maximum body size, in bytes.
|
Connection.Request |
maxBodySize(int bytes)
Update the maximum body size, in bytes.
|
Parser |
parser()
Get the current parser to use when parsing the document.
|
Connection.Request |
parser(Parser parser)
Specify the parser to use when parsing the document.
|
String |
postDataCharset()
Gets the post data character set for x-www-form-urlencoded post data
|
Connection.Request |
postDataCharset(String charset)
Sets the post data character set for x-www-form-urlencoded post data
|
Proxy |
proxy()
Get the proxy used for this request.
|
Connection.Request |
proxy(Proxy proxy)
Update the proxy for this request.
|
Connection.Request |
proxy(String host,
int port)
Set the HTTP proxy to use for this request.
|
String |
requestBody()
Get the current request body.
|
Connection.Request |
requestBody(String body)
Set a POST (or PUT) request body.
|
int |
timeout()
Get the request timeout, in milliseconds.
|
Connection.Request |
timeout(int millis)
Update the request timeout.
|
boolean |
validateTLSCertificates()
Get the current state of TLS (SSL) certificate validation.
|
void |
validateTLSCertificates(boolean value)
Set TLS certificate validation.
|
addHeader, cookie, cookie, cookies, hasCookie, hasHeader, hasHeaderWithValue, header, header, headers, headers, method, method, multiHeaders, removeCookie, removeHeader, url, url
Connection.Request proxy(Proxy proxy)
proxy
- the proxy ot use; null
to disable.Connection.Request proxy(String host, int port)
host
- the proxy hostnameport
- the proxy portint timeout()
Connection.Request timeout(int millis)
millis
- timeout, in millisecondsint maxBodySize()
Connection.Request maxBodySize(int bytes)
bytes
- maximum body size, in bytes.boolean followRedirects()
Connection.Request followRedirects(boolean followRedirects)
followRedirects
- true if server redirects should be followed.boolean ignoreHttpErrors()
Connection.Request ignoreHttpErrors(boolean ignoreHttpErrors)
ignoreHttpErrors
- set to true to ignore HTTP errors.boolean ignoreContentType()
Connection.Request ignoreContentType(boolean ignoreContentType)
ignoreContentType
- set to true to ignore the content type.boolean validateTLSCertificates()
void validateTLSCertificates(boolean value)
value
- set false to ignore TLS (SSL) certificatesConnection.Request data(Connection.KeyVal keyval)
keyval
- data to add.Collection<Connection.KeyVal> data()
Connection.Request requestBody(String body)
Jsoup.connect(url)
.requestBody(json)
.header("Content-Type", "application/json")
.post();
If any data key/vals are supplied, they will be sent as URL query params.String requestBody()
Connection.Request parser(Parser parser)
parser
- parser to use.Parser parser()
Connection.Request postDataCharset(String charset)
charset
- character set to encode post dataString postDataCharset()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses