|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
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 | |
Response |
execute()
Execute this HTTP request. |
java.lang.String |
getLabel()
Assigns a text label to this request. |
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. |
void |
setCredentials(java.lang.String userName,
java.lang.String password)
Sets the basic authentication credentials for this request, if any. |
void |
setHeader(java.lang.String headerName,
java.lang.String headerValue)
Sets a request header. |
void |
setParameter(java.lang.String name,
java.lang.String value)
Associate a parameter with this request. |
void |
setParameters(java.util.Map parameters)
Associate a group of parameters with this request. |
| Field Detail |
public static final int HTTP_METHOD_GET
public static final int HTTP_METHOD_HEAD
public static final int HTTP_METHOD_POST
| Method Detail |
public Response execute()
throws java.io.IOException
java.io.IOException - if the remote server could not be reachedpublic java.lang.String getLabel()
public int getRequestTiming()
public Session getSession()
Session objectpublic java.net.URL getURL()
public void setCredentials(java.lang.String userName,
java.lang.String password)
userName - user namepassword - user's password
public void setHeader(java.lang.String headerName,
java.lang.String headerValue)
headerName - header nameheaderValue - header value or null for a null header
public void setParameter(java.lang.String name,
java.lang.String value)
name - the name of the parametername - the value of the parameterjava.lang.IllegalArgumentException - if a parameter is null or not a Stringpublic void setParameters(java.util.Map parameters)
parameters - a map of parameters (lvalues -> rvalues)java.lang.IllegalArgumentException - if a parameter is null or not a String
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||