Package org.jsoup.helper

## Class HttpConnection.Request

- java.lang.Object
- - org.jsoup.helper.HttpConnection.Request

All Implemented Interfaces:
  `Connection.Base<Connection.Request>`, `Connection.Request`

Enclosing class:
  HttpConnection

    public static class HttpConnection.Request
    extends java.lang.Object
    implements Connection.Request

### Method Summary

All Methods Instance Methods Concrete Methods
`java.util.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.
`java.lang.String` `postDataCharset()` Gets the post data character set for x-www-form-urlencoded post data
`Connection.Request` `postDataCharset​(java.lang.String charset)` Sets the post data character set for x-www-form-urlencoded post data
`java.net.Proxy` `proxy()` Get the proxy used for this request.
`HttpConnection.Request` `proxy​(java.lang.String host, int port)` Set the HTTP proxy to use for this request.
`HttpConnection.Request` `proxy​(java.net.Proxy proxy)` Update the proxy for this request.
`java.lang.String` `requestBody()` Get the current request body.
`Connection.Request` `requestBody​(java.lang.String body)` Set a POST (or PUT) request body.
`javax.net.ssl.SSLSocketFactory` `sslSocketFactory()` Get the current custom SSL socket factory, if any.
`void` `sslSocketFactory​(javax.net.ssl.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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.jsoup.Connection.Base

`addHeader, cookie, cookie, cookies, hasCookie, hasHeader, hasHeaderWithValue, header, header, headers, headers, method, method, multiHeaders, removeCookie, removeHeader, url, url`

### Method Detail

#### proxy

    public java.net.Proxy proxy()

Description copied from interface: `Connection.Request`
Get the proxy used for this request.

Specified by:
  `proxy` in interface `Connection.Request`
Returns:
  the proxy; `null` if not enabled.

#### proxy

    public HttpConnection.Request proxy​(@Nullable
                                        java.net.Proxy proxy)

Description copied from interface: `Connection.Request`
Update the proxy for this request.

Specified by:
  `proxy` in interface `Connection.Request`
Parameters:
  `proxy` - the proxy ot use; `null` to disable.
Returns:
  this Request, for chaining

#### proxy

    public HttpConnection.Request proxy​(java.lang.String host,
                                        int port)

Description copied from interface: `Connection.Request`
Set the HTTP proxy to use for this request.

Specified by:
  `proxy` in interface `Connection.Request`
Parameters:
  `host` - the proxy hostname
  `port` - the proxy port
Returns:
  this Connection, for chaining

#### timeout

    public int timeout()

Description copied from interface: `Connection.Request`
Get the request timeout, in milliseconds.

Specified by:
  `timeout` in interface `Connection.Request`
Returns:
  the timeout in milliseconds.

#### timeout

    public HttpConnection.Request timeout​(int millis)

Description copied from interface: `Connection.Request`
Update the request timeout.

Specified by:
  `timeout` in interface `Connection.Request`
Parameters:
  `millis` - timeout, in milliseconds
Returns:
  this Request, for chaining

#### maxBodySize

    public int maxBodySize()

Description copied from interface: `Connection.Request`
Get the maximum body size, in bytes.

Specified by:
  `maxBodySize` in interface `Connection.Request`
Returns:
  the maximum body size, in bytes.

#### maxBodySize

    public Connection.Request maxBodySize​(int bytes)

Description copied from interface: `Connection.Request`
Update the maximum body size, in bytes.

Specified by:
  `maxBodySize` in interface `Connection.Request`
Parameters:
  `bytes` - maximum body size, in bytes.
Returns:
  this Request, for chaining

#### followRedirects

    public boolean followRedirects()

Description copied from interface: `Connection.Request`
Get the current followRedirects configuration.

Specified by:
  `followRedirects` in interface `Connection.Request`
Returns:
  true if followRedirects is enabled.

#### followRedirects

    public Connection.Request followRedirects​(boolean followRedirects)

Description copied from interface: `Connection.Request`
Configures the request to (not) follow server redirects. By default this is true.

Specified by:
  `followRedirects` in interface `Connection.Request`
Parameters:
  `followRedirects` - true if server redirects should be followed.
Returns:
  this Request, for chaining

#### ignoreHttpErrors

    public boolean ignoreHttpErrors()

Description copied from interface: `Connection.Request`
Get the current ignoreHttpErrors configuration.

Specified by:
  `ignoreHttpErrors` in interface `Connection.Request`
Returns:
  true if errors will be ignored; false (default) if HTTP errors will cause an IOException to be thrown.

#### sslSocketFactory

    public javax.net.ssl.SSLSocketFactory sslSocketFactory()

Description copied from interface: `Connection.Request`
Get the current custom SSL socket factory, if any.

Specified by:
  `sslSocketFactory` in interface `Connection.Request`
Returns:
  custom SSL socket factory if set, null otherwise

#### sslSocketFactory

    public void sslSocketFactory​(javax.net.ssl.SSLSocketFactory sslSocketFactory)

Description copied from interface: `Connection.Request`
Set a custom SSL socket factory.

Specified by:
  `sslSocketFactory` in interface `Connection.Request`
Parameters:
  `sslSocketFactory` - SSL socket factory

#### ignoreHttpErrors

    public Connection.Request ignoreHttpErrors​(boolean ignoreHttpErrors)

Description copied from interface: `Connection.Request`
Configures the request to ignore HTTP errors in the response.

Specified by:
  `ignoreHttpErrors` in interface `Connection.Request`
Parameters:
  `ignoreHttpErrors` - set to true to ignore HTTP errors.
Returns:
  this Request, for chaining

#### ignoreContentType

    public boolean ignoreContentType()

Description copied from interface: `Connection.Request`
Get the current ignoreContentType configuration.

Specified by:
  `ignoreContentType` in interface `Connection.Request`
Returns:
  true if invalid content-types will be ignored; false (default) if they will cause an IOException to be thrown.

#### ignoreContentType

    public Connection.Request ignoreContentType​(boolean ignoreContentType)

Description copied from interface: `Connection.Request`
Configures the request to ignore the Content-Type of the response.

Specified by:
  `ignoreContentType` in interface `Connection.Request`
Parameters:
  `ignoreContentType` - set to true to ignore the content type.
Returns:
  this Request, for chaining

#### data

    public HttpConnection.Request data​(Connection.KeyVal keyval)

Description copied from interface: `Connection.Request`
Add a data parameter to the request

Specified by:
  `data` in interface `Connection.Request`
Parameters:
  `keyval` - data to add.
Returns:
  this Request, for chaining

#### data

    public java.util.Collection<Connection.KeyVal> data()

Description copied from interface: `Connection.Request`
Get all of the request's data parameters

Specified by:
  `data` in interface `Connection.Request`
Returns:
  collection of keyvals

#### requestBody

    public Connection.Request requestBody​(@Nullable
                                          java.lang.String body)

Description copied from interface: `Connection.Request`
Set a POST (or PUT) request body. Useful when a server expects a plain request body, not a set for URL encoded form key/value pairs. E.g.: `

    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.

Specified by:
  `requestBody` in interface `Connection.Request`
Parameters:
  `body` - to use as the request body. Set to null to clear a previously set body.
Returns:
  this Request, for chaining

#### requestBody

    public java.lang.String requestBody()

Description copied from interface: `Connection.Request`
Get the current request body.

Specified by:
  `requestBody` in interface `Connection.Request`
Returns:
  null if not set.

#### parser

    public HttpConnection.Request parser​(Parser parser)

Description copied from interface: `Connection.Request`
Specify the parser to use when parsing the document.

Specified by:
  `parser` in interface `Connection.Request`
Parameters:
  `parser` - parser to use.
Returns:
  this Request, for chaining

#### parser

    public Parser parser()

Description copied from interface: `Connection.Request`
Get the current parser to use when parsing the document.

Specified by:
  `parser` in interface `Connection.Request`
Returns:
  current Parser

#### postDataCharset

    public Connection.Request postDataCharset​(java.lang.String charset)

Description copied from interface: `Connection.Request`
Sets the post data character set for x-www-form-urlencoded post data

Specified by:
  `postDataCharset` in interface `Connection.Request`
Parameters:
  `charset` - character set to encode post data
Returns:
  this Request, for chaining

#### postDataCharset

    public java.lang.String postDataCharset()

Description copied from interface: `Connection.Request`
Gets the post data character set for x-www-form-urlencoded post data

Specified by:
  `postDataCharset` in interface `Connection.Request`
Returns:
  character set to encode post data