|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.ibm.wbi.protocol.http.HttpHeaderAscii
|
+--com.ibm.wbi.protocol.http.HttpRequestHeader
Class to describe a request header -- this is the header the client (browser) sends the the server (wbi RequestEditor, Generator or WWW server). The interface is (hopefully) more intuitive than the deprecated HttpRequest: you can change fields directly and see the changes instead of having to call produceRequestWithoutContent() and docInfo.setRequestHeader().
DocumentInfo,
HttpHeaderAscii| Field Summary | |
protected static java.lang.String |
DEFAULT_METHOD
|
protected static java.lang.String |
DEFAULT_URL
|
protected java.lang.String |
method
|
protected boolean |
othersOk
|
protected java.lang.String |
path
|
protected java.lang.String |
port
|
protected java.lang.String |
protocol
|
protected java.lang.String |
query
|
protected java.lang.String |
server
|
protected java.lang.String |
url
|
protected boolean |
urlOk
|
| Fields inherited from class com.ibm.wbi.protocol.http.HttpHeaderAscii |
httpVersion, mime, stamp |
| Constructor Summary | |
HttpRequestHeader()
Creates a new HttpRequestHeader instance. |
|
HttpRequestHeader(byte[] h)
Creates a new HttpRequestHeader instance based on
the specified bytes representing ASCII characters. |
|
HttpRequestHeader(byte[] h,
int offset,
int length)
Creates a new HttpRequestHeader instance based on
the specified bytes representing ASCII characters. |
|
HttpRequestHeader(HttpRequestHeader old)
Creates a new HttpRequestHeader instance based on
the specified exisiting HttpRequestHeader. |
|
HttpRequestHeader(MimeHeaderAscii m)
Creates a new HttpRequestHeader instance based on
the specified MimeHeaderAscii. |
|
HttpRequestHeader(java.lang.String s)
Creates a new HttpRequestHeader instance based on
the specified String. |
|
| Method Summary | |
byte[] |
asciiGetBytes(boolean rewriteForServer)
Return a textual representation of this HttpRequestHeader. |
java.lang.Object |
clone()
Return a clone of this HttpRequestHeader. |
java.lang.String |
getMethod()
Get the HTTP method (e.g., "GET", "PUT", "POST"). |
java.lang.String |
getPath()
Get the path from the request URL, e.g., "/index.html". |
java.lang.String |
getPort()
Get the port from the request URL, e.g., "80". |
java.lang.String |
getProtocol()
Get the protocol portion of the request URL, e.g., "http", "ftp", etc. |
java.lang.String |
getQuery()
Get the query portion of the request URL, e.g., "?xxx=yyy&z=a". |
java.lang.String |
getServer()
Get the server portion of the request URL, e.g., "www.almaden.ibm.com". |
java.lang.String |
getUrl()
Get the entire URL requested in the header. |
protected void |
parseFirstLine(java.lang.String line)
|
protected void |
parseUrl()
|
void |
setMethod(java.lang.String s)
Set the HTTP method. |
void |
setPath(java.lang.String s)
Set the path in the request URL. |
void |
setPort(java.lang.String s)
Set the port in the request URL. |
void |
setProtocol(java.lang.String s)
Set the protocol portion of the request URL. |
void |
setQuery(java.lang.String s)
Set the query portion of the request URL. |
void |
setServer(java.lang.String s)
Set the server portion of the request URL. |
void |
setServer(java.lang.String s,
boolean setHostField)
Set the server portion of the request URL. |
void |
setUrl(java.lang.String s)
Set the entire URL requested in the header. |
java.lang.String |
toString()
Return a textual representation of this HttpRequestHeader. |
java.lang.String |
toString(boolean rewriteForServer)
Return a textual representation of this HttpRequestHeader. |
protected java.lang.String |
urlString()
|
| Methods inherited from class com.ibm.wbi.protocol.http.HttpHeaderAscii |
add, add, copyMimeHeader, get, getAll, getMimeHeaderString, getRaw, getVersion, keys, parseAllHeaderFields, parseAllSplitHeaderFields, parseAllSplitHeaderFields, parseHeader, parseHeaderField, remove, set, set, setVersion, stamp, stamped |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.lang.String method
protected java.lang.String url
protected boolean urlOk
protected java.lang.String protocol
protected java.lang.String server
protected java.lang.String path
protected java.lang.String port
protected java.lang.String query
protected boolean othersOk
protected static final java.lang.String DEFAULT_METHOD
protected static final java.lang.String DEFAULT_URL
| Constructor Detail |
public HttpRequestHeader()
HttpRequestHeader instance.public HttpRequestHeader(MimeHeaderAscii m)
HttpRequestHeader instance based on
the specified MimeHeaderAscii.m - a MimeHeaderAscii value
public HttpRequestHeader(byte[] h)
throws MalformedHeaderException
HttpRequestHeader instance based on
the specified bytes representing ASCII characters.h - The array containing the bytes.
public HttpRequestHeader(byte[] h,
int offset,
int length)
throws MalformedHeaderException
HttpRequestHeader instance based on
the specified bytes representing ASCII characters.h - The array containing the bytes.offset - The offset within the array where the bytes start.length - The length of the bytes within the array.
public HttpRequestHeader(java.lang.String s)
throws MalformedHeaderException
HttpRequestHeader instance based on
the specified String.s - The string containing the header text.public HttpRequestHeader(HttpRequestHeader old)
HttpRequestHeader instance based on
the specified exisiting HttpRequestHeader.old - The existing HttpRequestHeader.| Method Detail |
public java.lang.Object clone()
HttpRequestHeader.clone in class java.lang.Objectpublic java.lang.String toString()
HttpRequestHeader.toString in class HttpHeaderAsciiString.public java.lang.String toString(boolean rewriteForServer)
HttpRequestHeader.rewriteForServer - If true, the first line of
the header will be modified from proxy form to server form.
E.g., "GET http://www.almaden.ibm.com/index.html HTTP/1.0"
becomes "GET /index.html HTTP/1.0".String.public byte[] asciiGetBytes(boolean rewriteForServer)
HttpRequestHeader.rewriteForServer - If true, the first line of
the header will be modified from proxy form to server form.
E.g., "GET http://www.almaden.ibm.com/index.html HTTP/1.0"
becomes "GET /index.html HTTP/1.0".public java.lang.String getMethod()
public void setMethod(java.lang.String s)
The - HTTP method.public java.lang.String getUrl()
public void setUrl(java.lang.String s)
s - The new URL.public java.lang.String getProtocol()
public void setProtocol(java.lang.String s)
s - The protocol.public java.lang.String getServer()
public void setServer(java.lang.String s)
s - The server.
public void setServer(java.lang.String s,
boolean setHostField)
s - The server.setHostField - Whether to update the "Host:" field of the
header correspondingly.public java.lang.String getPath()
public void setPath(java.lang.String s)
s - The path.public java.lang.String getPort()
public void setPort(java.lang.String s)
s - The port.public java.lang.String getQuery()
public void setQuery(java.lang.String s)
s - The query.protected java.lang.String urlString()
protected void parseUrl()
protected void parseFirstLine(java.lang.String line)
throws MalformedHeaderException
parseFirstLine in class HttpHeaderAscii
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||