|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A request to be applied to an HttpConnection,
and a container for the associated response.
| Method Summary | |
void |
addRequestHeader(Header header)
Adds the specified request header, NOT overwriting any previous value. |
void |
addRequestHeader(java.lang.String headerName,
java.lang.String headerValue)
Adds the specified request header, NOT overwriting any previous value. |
void |
addResponseFooter(Header footer)
Use this method internally to add footers. |
int |
execute(HttpState state,
HttpConnection connection)
Execute this method. |
boolean |
getFollowRedirects()
Whether or not I should automatically follow HTTP redirects (status code 302, etc.) |
java.lang.String |
getName()
Obtain the name of this method, suitable for use in the "request line", for example "GET" or "POST". |
java.lang.String |
getPath()
Get the path part of my request. |
java.lang.String |
getQueryString()
Get my query string. |
Header |
getRequestHeader(java.lang.String headerName)
Get the request header associated with the given name. |
Header[] |
getRequestHeaders()
Return an array of my request headers. |
byte[] |
getResponseBody()
Return my response body, if any, as a byte array. |
java.io.InputStream |
getResponseBodyAsStream()
Return my response body, if any, as an InputStream. |
java.lang.String |
getResponseBodyAsString()
Return my response body, if any, as a String. |
Header |
getResponseFooter(java.lang.String footerName)
Return the specified response footer. |
Header[] |
getResponseFooters()
Return an array of my response footers |
Header |
getResponseHeader(java.lang.String headerName)
Return the specified response header. |
Header[] |
getResponseHeaders()
Return an array of my response headers. |
int |
getStatusCode()
Return the status code associated with the latest response. |
java.lang.String |
getStatusText()
Return the status text (or "reason phrase") associated with the latest response. |
boolean |
hasBeenUsed()
Return true if I have been executed
but not recycled. |
boolean |
isStrictMode()
Returns the value of strictMode. |
void |
recycle()
Recycle this method so that it can be used again. |
void |
removeRequestHeader(java.lang.String headerName)
Remove all request headers associated with the given name. |
void |
setFollowRedirects(boolean followRedirects)
Set whether or not I should automatically follow HTTP redirects (status code 302, etc.) |
void |
setPath(java.lang.String path)
Set the path part of my request. |
void |
setQueryString(NameValuePair[] params)
Set my query string. |
void |
setQueryString(java.lang.String queryString)
Set my query string. |
void |
setRequestHeader(Header header)
Set the specified request header, overwriting any previous value. |
void |
setRequestHeader(java.lang.String headerName,
java.lang.String headerValue)
Set the specified request header, overwriting any previous value. |
void |
setStrictMode(boolean strictMode)
Turns strict mode on or off. |
boolean |
validate()
Confirm that I am ready to execute. |
| Method Detail |
public java.lang.String getName()
public void setPath(java.lang.String path)
path - the path to requestpublic java.lang.String getPath()
public void setStrictMode(boolean strictMode)
public boolean isStrictMode()
public void setRequestHeader(java.lang.String headerName,
java.lang.String headerValue)
headerName - the header's nameheaderValue - the header's valuepublic void setRequestHeader(Header header)
header - the header
public void addRequestHeader(java.lang.String headerName,
java.lang.String headerValue)
headerName - the header's nameheaderValue - the header's valuepublic void addRequestHeader(Header header)
header - the headerpublic Header getRequestHeader(java.lang.String headerName)
headerName - the header namepublic void removeRequestHeader(java.lang.String headerName)
headerName - the header namepublic boolean getFollowRedirects()
public void setFollowRedirects(boolean followRedirects)
public void setQueryString(java.lang.String queryString)
queryString - the query stringpublic void setQueryString(NameValuePair[] params)
params - an array of NameValuePairs
to add as query string parametersspublic java.lang.String getQueryString()
public Header[] getRequestHeaders()
public boolean validate()
public int getStatusCode()
public java.lang.String getStatusText()
public Header[] getResponseHeaders()
public Header getResponseHeader(java.lang.String headerName)
public Header[] getResponseFooters()
public Header getResponseFooter(java.lang.String footerName)
public byte[] getResponseBody()
public java.lang.String getResponseBodyAsString()
String.
Otherwise return null.
public java.io.InputStream getResponseBodyAsStream()
throws java.io.IOException
InputStream.
Otherwise return null.public boolean hasBeenUsed()
executed
but not recycled.
public int execute(HttpState state,
HttpConnection connection)
throws HttpException,
java.io.IOException
state - state information to associate with this requestconnection - the HttpConnection to write to/read fromjava.io.IOException - if an I/O error occursHttpException - if an protocol exception occurspublic void recycle()
public void addResponseFooter(Header footer)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||