class HttpClientRequest extends java.lang.Object
A class to store configuration details for an HTTP request.
Modifiers | Name | Description |
---|---|---|
protected org.apache.http.impl.client.BasicCookieStore |
cookieStore |
Constructor and description |
---|
protected HttpClientRequest(java.lang.String baseUrl, java.lang.String path, HttpMethod method) |
Type Params | Return Type | Name and description |
---|---|---|
|
protected java.lang.Object |
getBody() |
|
HttpClientRequest |
setBody(java.lang.Object body) Set the request body. |
|
HttpClientRequest |
setBody(java.lang.String body, java.lang.String contentType) Set a String as the request body and specify its content type using a String. |
|
HttpClientRequest |
setCookie(java.lang.String name, java.lang.String value) Set a request cookie. |
|
HttpClientRequest |
setHeader(java.lang.String name, java.lang.String value) Add a header to the request. |
|
HttpClientRequest |
setMethod(HttpMethod method) Set the HTTP method for the request. |
|
HttpClientRequest |
setParam(java.lang.String name, java.lang.String[] values) Set a URL parameter. |
|
HttpClientRequest |
setPath(java.lang.String path) Set the path for the request. |
|
protected org.apache.http.client.methods.HttpUriRequest |
toHttpUriRequest() Converts this request into an Apache HttpUriRequest for use by the HttpClient. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Set the request body.
body
- The body of the request. It should be an instance of FormData or String.Set a String as the request body and specify its content type using a String. Common content types can be found in ContentTypes.
body
- The request body.contentType
- The Content-Type of the request.Set a request cookie.
name
- The name of the cookie.value
- The cookie value.Add a header to the request.
name
- Header name.value
- Header value.Set the HTTP method for the request.
method
- The HTTP method.Set a URL parameter.
name
- The name of the parameter.values
- One or more values for the parameter (as in the case of a checkbox array).Set the path for the request.
path
- The path for the request.Converts this request into an Apache HttpUriRequest for use by the HttpClient.