|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.ibm.wbi.protocol.http.HttpBase
|
+--com.ibm.wbi.protocol.http.HttpRequest
HttpRequestHeader, HttpResponseHeader,
HttpHeaderAscii).
This class is used to manipulate HTTP 1.0 requests. It can be constructed with default value, from a request string, or from a MegInputStream (that comes from a RequestEvent).
The request can then be manipulated through various properties.
Finally, the request can be produced as a String, or written to the MegOutputStream associated with a RequestEvent.
HttpHeaderAscii,
HttpRequestHeader,
HttpResponseHeader| Field Summary | |
static java.lang.String |
COPYRIGHT
Deprecated. |
protected HttpRequestHeader |
rheader
Deprecated. |
| Fields inherited from class com.ibm.wbi.protocol.http.HttpBase |
content, header |
| Constructor Summary | |
HttpRequest()
Deprecated. Construct a default HTTP 1.0 request, which is a "GET" of "http://www.ibm.com" with no other header information. |
|
HttpRequest(HttpRequestHeader request)
Deprecated. |
|
HttpRequest(ResponseToRequest rtr,
boolean loadContent)
Deprecated. Construct an HTTP 1.0 request from the request in the given MegInputStream. |
|
HttpRequest(java.lang.String request)
Deprecated. Construct an HTTP 1.0 request from a request String. |
|
| Method Summary | |
void |
addQueryTerm(java.lang.String key,
java.lang.String value)
Deprecated. Add a term to the query portion of the request (following a '?' in a "GET" request). |
java.lang.String |
getCookie(java.lang.String name)
Deprecated. Inefficient for accessing multiple cookies! |
java.util.Properties |
getCookies()
Deprecated. Access the cookies that are being passed to the server with this request. |
java.lang.String |
getMethod()
Deprecated. Access the HTTP request method. |
static java.lang.String |
getPathFromFile(java.net.URL u)
Deprecated. Return the path portion of the given URL, without the protocol, the server, or the query portion. |
static java.lang.String |
getQueryFromFile(java.net.URL u)
Deprecated. Return the query portion of the given URL, without the protocol, the server, or the file portion. |
java.lang.String |
getUrl()
Deprecated. Access the HTTP request URL. |
void |
loadRequestContent(ResponseToRequest rtr)
Deprecated. Load the request contents that are in the given MegInputStream. |
static void |
main(java.lang.String[] args)
Deprecated. Test Driver. |
void |
parseRequestHeader(java.lang.String request)
Deprecated. Parse the HTTP request that is contained in the given String and set the properties in this object to correspond to that request. |
java.lang.String |
produceRequestWithContent()
Deprecated. Produces request header up through the double \r\n, plus any request content |
java.lang.String |
produceRequestWithoutContent()
Deprecated. Produces request header up through the double \r\n, but excludes any request content (e.g. |
java.net.URL |
produceURLObject()
Deprecated. Converts the requested URL into a URL object. |
void |
setMethod(java.lang.String m)
Deprecated. Set the HTTP request method |
void |
setServer(java.lang.String newServerName)
Deprecated. Change the server name for the URL in this request, but leave everything else unaffected. |
void |
setUrl(java.lang.String u)
Deprecated. Set the HTTP request URL |
void |
writeRequest(RequestEvent e)
Deprecated. Write the HTTP request into the MegOutputStream associated with the given RequestEvent. |
| Methods inherited from class com.ibm.wbi.protocol.http.HttpBase |
add, change, get, getAll, getContent, getContentLength, getContentType, getKeys, getProtocolVersion, initialize, remove, remove, removeAll, set, setContent, setContentLength, setContentType, setProtocolVersion |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String COPYRIGHT
protected HttpRequestHeader rheader
| Constructor Detail |
public HttpRequest()
public HttpRequest(ResponseToRequest rtr,
boolean loadContent)
rtr - The ResponseToRequest containing the original HTTP
request (RequestEvent and ServiceResult
implement that interface).loadContent - If true, the request content (if any) is loaded
and made available through the
getContent() method.public HttpRequest(java.lang.String request)
GET http://www.ibm.com/ HTTP/1.0 \r\n accept-type: text/html \r\n \r\n
request - the HTTP 1.0 request Stringpublic HttpRequest(HttpRequestHeader request)
| Method Detail |
public void setMethod(java.lang.String m)
m - The request method (e.g. "GET", "PUT", "POST", etc.)public void setUrl(java.lang.String u)
u - The requested URL, can be either of proxy form
(e.g. "http://www.ibm.com") or server form
(e.g. "/foo/bar.html")public java.lang.String getMethod()
public java.lang.String getUrl()
public java.util.Properties getCookies()
Properties object.public java.lang.String getCookie(java.lang.String name)
name - The cookie.null if no value for this name.getCookies()public java.lang.String produceRequestWithoutContent()
public java.lang.String produceRequestWithContent()
public void writeRequest(RequestEvent e)
e - The RequestEvent to which the HTTP request should be
written (usually the one that was given to your
RequestEditor.handleRequest() method)public void parseRequestHeader(java.lang.String request)
request - The request to parse.public void loadRequestContent(ResponseToRequest rtr)
rtr - The ResponseToRequest (RequestEvent or ServiceResult)
public void addQueryTerm(java.lang.String key,
java.lang.String value)
key - The attribute name for the query termvalue - The attribute value for the query termpublic void setServer(java.lang.String newServerName)
newServerName - The name of the new server to which the request
should be aimedpublic java.net.URL produceURLObject()
public static java.lang.String getPathFromFile(java.net.URL u)
u - The URL to parse.public static java.lang.String getQueryFromFile(java.net.URL u)
u - The URL to parse.public static void main(java.lang.String[] args)
args - Command line arguments.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||