java.lang.Object | |
↳ | org.jsoup.helper.HttpConnection |
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
HttpConnection.KeyVal | |||||||||||
HttpConnection.Request | |||||||||||
HttpConnection.Response |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Set a cookie to be sent in the request
| |||||||||||
Add a request data parameter.
| |||||||||||
Add a number of request data parameters.
| |||||||||||
Adds all of the supplied data to the request data parameters
| |||||||||||
Execute the request.
| |||||||||||
Configures the connection to (not) follow server redirects.
| |||||||||||
Execute the request as a GET, and parse the result.
| |||||||||||
Set a request header.
| |||||||||||
Set the request method to use, GET or POST.
| |||||||||||
Execute the request as a POST, and parse the result.
| |||||||||||
Set the request referrer (aka "referer") header.
| |||||||||||
Set the connection's request
| |||||||||||
Get the request object associatated with this connection
| |||||||||||
Set the conenction's response
| |||||||||||
Get the response, once the request has been executed
| |||||||||||
Set the request timeouts (connect and read).
| |||||||||||
Set the request URL to fetch.
| |||||||||||
Set the request URL to fetch.
| |||||||||||
Set the request user-agent header.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Set a cookie to be sent in the request
name | name of cookie |
---|---|
value | value of cookie |
Add a request data parameter. Request parameters are sent in the request query string for GETs, and in the request body for POSTs. A request may have multiple values of the same name.
key | data key |
---|---|
value | data value |
Add a number of request data parameters. Multiple parameters may be set at once, e.g.:
.data("name", "jsoup", "language", "Java", "language", "English");
creates a query string like:
?name=jsoup&language=Java&language=English
keyvals | a set of key value pairs. |
---|
Adds all of the supplied data to the request data parameters
data | map of data parameters |
---|
Configures the connection to (not) follow server redirects. By default this is true.
followRedirects | true if server redirects should be followed. |
---|
Set a request header.
name | header name |
---|---|
value | header value |
Set the request method to use, GET or POST. Default is GET.
method | HTTP request method |
---|
Set the request referrer (aka "referer") header.
referrer | referrer to use |
---|
Set the connection's request
request | new request object |
---|
Get the request object associatated with this connection
Set the conenction's response
response | new response |
---|
Get the response, once the request has been executed
Set the request timeouts (connect and read). If a timeout occurs, an IOException will be thrown. The default timeout is 3 seconds (3000 millis). A timeout of zero is treated as an infinite timeout.
millis | number of milliseconds (thousandths of a second) before timing out connects or reads. |
---|
Set the request URL to fetch. The protocol must be HTTP or HTTPS.
url | URL to connect to |
---|
Set the request URL to fetch. The protocol must be HTTP or HTTPS.
url | URL to connect to |
---|
Set the request user-agent header.
userAgent | user-agent to use |
---|