Connection.Base<Connection.Request>, Connection.Requestpublic static class HttpConnection.Request extends Object implements Connection.Request
| Modifier and Type | Method | Description |
|---|---|---|
Collection<Connection.KeyVal> |
data() |
Get all of the request's data parameters
|
HttpConnection.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.
|
HttpConnection.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.
|
HttpConnection.Request |
proxy(String host,
int port) |
Set the HTTP proxy to use for this request.
|
HttpConnection.Request |
proxy(Proxy proxy) |
Update the proxy for this request.
|
String |
requestBody() |
Get the current request body.
|
Connection.Request |
requestBody(String body) |
Set a POST (or PUT) request body.
|
SSLSocketFactory |
sslSocketFactory() |
Get the current custom SSL socket factory, if any.
|
void |
sslSocketFactory(SSLSocketFactory sslSocketFactory) |
Set a custom SSL socket factory.
|
int |
timeout() |
Get the request timeout, in milliseconds.
|
HttpConnection.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, urlpublic Proxy proxy()
Connection.Requestproxy in interface Connection.Requestnull if not enabled.public HttpConnection.Request proxy(Proxy proxy)
Connection.Requestproxy in interface Connection.Requestproxy - the proxy ot use; null to disable.public HttpConnection.Request proxy(String host, int port)
Connection.Requestproxy in interface Connection.Requesthost - the proxy hostnameport - the proxy portpublic int timeout()
Connection.Requesttimeout in interface Connection.Requestpublic HttpConnection.Request timeout(int millis)
Connection.Requesttimeout in interface Connection.Requestmillis - timeout, in millisecondspublic int maxBodySize()
Connection.RequestmaxBodySize in interface Connection.Requestpublic Connection.Request maxBodySize(int bytes)
Connection.RequestmaxBodySize in interface Connection.Requestbytes - maximum body size, in bytes.public boolean followRedirects()
Connection.RequestfollowRedirects in interface Connection.Requestpublic Connection.Request followRedirects(boolean followRedirects)
Connection.RequestfollowRedirects in interface Connection.RequestfollowRedirects - true if server redirects should be followed.public boolean ignoreHttpErrors()
Connection.RequestignoreHttpErrors in interface Connection.Requestpublic boolean validateTLSCertificates()
Connection.RequestvalidateTLSCertificates in interface Connection.Requestpublic void validateTLSCertificates(boolean value)
Connection.RequestvalidateTLSCertificates in interface Connection.Requestvalue - set false to ignore TLS (SSL) certificatesConnection.Request.sslSocketFactory(SSLSocketFactory)public SSLSocketFactory sslSocketFactory()
Connection.RequestsslSocketFactory in interface Connection.Requestpublic void sslSocketFactory(SSLSocketFactory sslSocketFactory)
Connection.RequestsslSocketFactory in interface Connection.RequestsslSocketFactory - SSL socket factorypublic Connection.Request ignoreHttpErrors(boolean ignoreHttpErrors)
Connection.RequestignoreHttpErrors in interface Connection.RequestignoreHttpErrors - set to true to ignore HTTP errors.public boolean ignoreContentType()
Connection.RequestignoreContentType in interface Connection.Requestpublic Connection.Request ignoreContentType(boolean ignoreContentType)
Connection.RequestignoreContentType in interface Connection.RequestignoreContentType - set to true to ignore the content type.public HttpConnection.Request data(Connection.KeyVal keyval)
Connection.Requestdata in interface Connection.Requestkeyval - data to add.public Collection<Connection.KeyVal> data()
Connection.Requestdata in interface Connection.Requestpublic Connection.Request requestBody(String body)
Connection.RequestJsoup.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.requestBody in interface Connection.Requestpublic String requestBody()
Connection.RequestrequestBody in interface Connection.Requestpublic HttpConnection.Request parser(Parser parser)
Connection.Requestparser in interface Connection.Requestparser - parser to use.public Parser parser()
Connection.Requestparser in interface Connection.Requestpublic Connection.Request postDataCharset(String charset)
Connection.RequestpostDataCharset in interface Connection.Requestcharset - character set to encode post datapublic String postDataCharset()
Connection.RequestpostDataCharset in interface Connection.RequestCopyright © 2009–2018 Jonathan Hedley. All rights reserved.