|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.owasp.webscarab.model.Message
org.owasp.webscarab.model.Request
public class Request
This class represents a request that can be sent to an HTTP server.
Field Summary |
---|
Fields inherited from class org.owasp.webscarab.model.Message |
---|
_logger |
Constructor Summary | |
---|---|
Request()
Creates a new instance of Request |
|
Request(Request req)
Creates a new Request, which is a copy of the supplied Request |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getMethod()
gets the Request method |
HttpUrl |
getURL()
Gets the Request URL |
java.lang.String |
getVersion()
gets the HTTP version |
void |
parse(java.lang.String string)
parses a string representation of a request |
void |
parse(java.lang.StringBuffer buff)
parses a string representation of a request |
void |
read(java.io.InputStream is)
initialises the Request from the supplied InputStream |
void |
read(java.io.InputStream is,
HttpUrl base)
initialises the Request from the supplied InputStream, using the supplied Url as a base. |
void |
setMethod(java.lang.String method)
Sets the request method |
void |
setURL(HttpUrl url)
Sets the Request URL |
void |
setVersion(java.lang.String version)
Sets the HTTP version supported |
java.lang.String |
toString()
returns a string representation of the Request, using a CRLF of "\r\n" |
java.lang.String |
toString(java.lang.String crlf)
returns a string representation of the Request, using the supplied string to separate lines |
void |
write(java.io.OutputStream os)
Writes the Request to the supplied OutputStream, in a format appropriate for sending to an HTTP proxy. |
void |
write(java.io.OutputStream os,
java.lang.String crlf)
Writes the Request to the supplied OutputStream, in a format appropriate for sending to an HTTP proxy. |
void |
writeDirect(java.io.OutputStream os)
Writes the Request to the supplied OutputStream, in a format appropriate for sending to the HTTP server itself. |
void |
writeDirect(java.io.OutputStream os,
java.lang.String crlf)
Writes the Request to the supplied OutputStream, in a format appropriate for sending to the HTTP server itself. |
Methods inherited from class org.owasp.webscarab.model.Message |
---|
addHeader, addHeader, deleteHeader, flushContentStream, getContent, getHeader, getHeaderNames, getHeaders, getHeaders, getLine, readLine, setContent, setHeader, setHeader, setHeaders, setNoBody |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Request()
public Request(Request req)
req
- the request to copyMethod Detail |
---|
public void read(java.io.InputStream is) throws java.io.IOException
read
in class Message
is
- the InputStream to read from
java.io.IOException
- propagates any exceptions thrown by the InputStreampublic void read(java.io.InputStream is, HttpUrl base) throws java.io.IOException
is
- the InputStream to read frombase
- the base Url to use for relative Urls
java.io.IOException
- propagates any IOExceptions thrown by the InputStreampublic void parse(java.lang.String string) throws java.text.ParseException
string
- the string representing the request
java.text.ParseException
- if there are any errors parsing the requestpublic void parse(java.lang.StringBuffer buff) throws java.text.ParseException
parse
in class Message
buff
- a StringBuffer containing the request. Note that the contents of the StringBuffer are consumed during parsing.
java.text.ParseException
- if there are any errors parsing the requestpublic void write(java.io.OutputStream os) throws java.io.IOException
write
in class Message
os
- the OutputStream to write to
java.io.IOException
- if the underlying stream throws any.public void write(java.io.OutputStream os, java.lang.String crlf) throws java.io.IOException
write
in class Message
os
- the OutputStream to write tocrlf
- the string to use to separate the lines (usually a CRLF pair)
java.io.IOException
- if the underlying stream throws any.public void writeDirect(java.io.OutputStream os) throws java.io.IOException
os
- the OutputStream to write to
java.io.IOException
- if the underlying stream throws any.public void writeDirect(java.io.OutputStream os, java.lang.String crlf) throws java.io.IOException
os
- the OutputStream to write tocrlf
- the string to use to separate the lines (usually a CRLF pair)
java.io.IOException
- if the underlying stream throws any.public void setMethod(java.lang.String method)
method
- the method of the request (automatically converted to uppercase)public java.lang.String getMethod()
public void setURL(HttpUrl url)
url
- the urlpublic HttpUrl getURL()
public void setVersion(java.lang.String version)
version
- the version of the request. Automatically converted to uppercase.public java.lang.String getVersion()
public java.lang.String toString()
toString
in class Message
public java.lang.String toString(java.lang.String crlf)
toString
in class Message
crlf
- the string to use to separate lines (usually CRLF)
public boolean equals(java.lang.Object obj)
equals
in class Message
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |