Class Apache5HttpRequest (2.0.3)

public final class Apache5HttpRequest extends LowLevelHttpRequest

Inheritance

java.lang.Object > LowLevelHttpRequest > Apache5HttpRequest

Methods

addHeader(String name, String value)

public void addHeader(String name, String value)

Adds a header to the HTTP request.

Note that multiple headers of the same name need to be supported, in which case #addHeader will be called for each instance of the header.

Parameters
Name Description
name String
value String
Overrides

execute()

public LowLevelHttpResponse execute()

Executes the request and returns a low-level HTTP response object.

Returns
Type Description
LowLevelHttpResponse
Overrides
Exceptions
Type Description
IOException

setTimeout(int connectTimeout, int readTimeout)

public void setTimeout(int connectTimeout, int readTimeout)

Configures the connection, connection request and read timeout of the request.

Parameters
Name Description
connectTimeout int

timeout in milliseconds to establish a connection or 0 for an infinite timeout. This parameter will also set the underlying request configuration's connection request timeout. See org.apache.hc.client5.http.config.RequestConfig.Builder#setConnectionRequestTimeout(long, TimeUnit) for more details.

readTimeout int

Timeout in milliseconds to read data from an established connection or 0 for an infinite timeout

Overrides
Exceptions
Type Description
IOException