public final class Apache5HttpRequest extends LowLevelHttpRequestMethods
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 |
execute()
public LowLevelHttpResponse execute()Executes the request and returns a low-level HTTP response object.
| Returns | |
|---|---|
| Type | Description |
LowLevelHttpResponse |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
setTimeout(int connectTimeout, int readTimeout)
public void setTimeout(int connectTimeout, int readTimeout)Sets the connection and read timeouts.
Default implementation does nothing, but subclasses should normally override.
| Parameters | |
|---|---|
| Name | Description |
connectTimeout |
int |
readTimeout |
int |
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|