|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Request
A Latka Request represents a request from an HTTP server.
Field Summary | |
---|---|
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 |
Method Summary | |
---|---|
void |
addHeader(String headerName,
String headerValue)
Sets a request header. |
void |
addParameter(String name,
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. |
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. |
URL |
getURL()
Gets the URL that Latka will attempt to contact. |
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(String body)
Set the request body for a manual POST. |
void |
setVersion(String version)
Sets the version of HTTP that is used in the request. |
Field Detail |
---|
static final int HTTP_METHOD_GET
static final int HTTP_METHOD_POST
static final int HTTP_METHOD_HEAD
Method Detail |
---|
Response execute() throws IOException
IOException
- if the remote server could not be reachedString getLabel()
URL getURL()
void addParameter(String name, 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(String headerName, 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(String body)
body
- Body to POSTvoid setVersion(String version)
version
- HTTP version.String getVersion()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |