public interface Request
| Modifier and Type | Field and Description |
|---|---|
static int |
HTTP_METHOD_GET
An integer representing the HTTP GET method
|
static int |
HTTP_METHOD_HEAD
An integer representing the HTTP POST method
|
static int |
HTTP_METHOD_POST
An integer representing the HTTP POST method
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(java.lang.String headerName,
java.lang.String headerValue)
Sets a request header.
|
void |
addParameter(java.lang.String name,
java.lang.String value)
Associate a parameter with this request.
|
Response |
execute()
Execute this HTTP request.
|
boolean |
followRedirects()
Whether or not this request will instruct HttpClient
to follow local redirects automatically.
|
Credentials |
getCredentials()
Return the credentials for this request
|
RequestHeaders |
getHeaders()
Get the headers for the request, so that they can
be copied to another request if necessary.
|
java.lang.String |
getLabel()
Assigns a text label to this request.
|
int |
getMethod()
Return the constant representing the HTTP method
to use in this request
|
Parameters |
getParameters()
Get the parameters for the request, so that they can
be copied to another request if necessary.
|
int |
getRequestTiming()
The amount of time it took to execute the
request in milliseconds, or -1 if the request has not
been executed successfully
|
Session |
getSession()
Retrieve the session associated with this request.
|
java.net.URL |
getURL()
Gets the URL that Latka will attempt to contact.
|
java.lang.String |
getVersion()
Get the HTTP version to use in this request
|
void |
setCredentials(Credentials credentials)
Sets the basic authentication credentials for this request,
if any.
|
void |
setHeaders(RequestHeaders requestHeaders)
Set all the headers for the request.
|
void |
setParameters(Parameters parameters)
Set all the parameters for the request.
|
void |
setRequestBody(java.lang.String body)
Set the request body for a manual POST.
|
void |
setVersion(java.lang.String version)
Sets the version of HTTP that is used in the request.
|
static final int HTTP_METHOD_GET
static final int HTTP_METHOD_POST
static final int HTTP_METHOD_HEAD
Response execute() throws java.io.IOException
java.io.IOException - if the remote server could not be reachedjava.lang.String getLabel()
java.net.URL getURL()
void addParameter(java.lang.String name,
java.lang.String value)
name - the name of the parametervalue - the value of the parametervoid setParameters(Parameters parameters)
parameters - all parameters for this requestParameters getParameters()
void addHeader(java.lang.String headerName,
java.lang.String headerValue)
headerName - header nameheaderValue - header value or null for a null headervoid setHeaders(RequestHeaders requestHeaders)
requestHeaders - all headers for this requestRequestHeaders getHeaders()
Session getSession()
Session objectint getRequestTiming()
void setCredentials(Credentials credentials)
credentials - user's identificationCredentials getCredentials()
boolean followRedirects()
int getMethod()
void setRequestBody(java.lang.String body)
body - Body to POSTvoid setVersion(java.lang.String version)
version - HTTP version.java.lang.String getVersion()
Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.