|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mmhttp.protocol.Request
public class Request
This class is one of the primary work horses of MM HTTP. It parses incoming HTTP Requests and provided accessors to the data. Although compliant to the HTTP 1.1 protocol, it is by no means complete. For example, only the GET and POST methods are supported. But is does support multipart content and file uploads.
Field Summary | |
---|---|
protected java.lang.String |
authorizationPassword
|
protected java.lang.String |
authorizationUsername
|
protected java.lang.String |
entityBody
|
protected java.util.HashMap<java.lang.String,java.lang.String> |
headers
|
protected mmsocketserver.StreamReader |
input
|
protected java.util.HashMap<java.lang.String,java.lang.Object> |
inputs
|
protected java.lang.String |
queryString
|
protected java.lang.String |
requestLine
|
protected java.lang.String |
requestURI
|
protected java.lang.String |
resource
|
Constructor Summary | |
---|---|
protected |
Request()
|
|
Request(java.io.InputStream input)
Constructs a new Request with the provided InputStream, however the stream will not be read and the request will not be parsed until calling parse(). |
Method Summary | |
---|---|
static java.lang.String |
decodeContent(java.lang.String content)
Decodes the URL unescaping all the escaped characters. |
java.lang.String |
getAuthorizationPassword()
|
java.lang.String |
getAuthorizationUsername()
|
java.lang.String |
getBody()
|
int |
getContentLength()
|
java.lang.String |
getHeader(java.lang.String key)
Retrieves the value of HTTP headers in the request. |
java.lang.Object |
getInput(java.lang.String key)
Retrives the value of inputs that were included in the query string or multipart data of the request. |
java.lang.String |
getQueryString()
|
java.lang.String |
getRequestLine()
|
java.lang.String |
getRequestUri()
|
java.lang.String |
getResource()
|
java.lang.String |
getUserpass(java.lang.String headerValue)
Helper method public only for testing. |
boolean |
hasBeenParsed()
|
boolean |
hasHeader(java.lang.String key)
|
boolean |
hasInput(java.lang.String key)
Tells you if the specified input was included in the query string or multipart data. |
long |
numberOfBytesParsed()
Sometimes clients will stop transmitting halfway through a request. |
void |
parse()
Parses the request. |
void |
parseCredentials()
The digest authentication parameters are not used by default. |
protected void |
parseQueryString(java.lang.String queryString)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected mmsocketserver.StreamReader input
protected java.lang.String requestURI
protected java.lang.String resource
protected java.lang.String queryString
protected java.util.HashMap<java.lang.String,java.lang.Object> inputs
protected java.util.HashMap<java.lang.String,java.lang.String> headers
protected java.lang.String entityBody
protected java.lang.String requestLine
protected java.lang.String authorizationUsername
protected java.lang.String authorizationPassword
Constructor Detail |
---|
protected Request()
public Request(java.io.InputStream input) throws java.lang.Exception
input
-
java.lang.Exception
Method Detail |
---|
public void parse() throws java.lang.Exception
java.lang.Exception
public int getContentLength()
protected void parseQueryString(java.lang.String queryString)
public java.lang.String getRequestLine()
public java.lang.String getRequestUri()
public java.lang.String getResource()
public java.lang.String getQueryString()
getInput(java.lang.String)
public boolean hasInput(java.lang.String key)
key
-
public java.lang.Object getInput(java.lang.String key)
key
-
UploadedFile
public boolean hasHeader(java.lang.String key)
key
-
public java.lang.String getHeader(java.lang.String key)
key
-
public java.lang.String getBody()
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String decodeContent(java.lang.String content)
content
-
public boolean hasBeenParsed()
public java.lang.String getUserpass(java.lang.String headerValue) throws java.lang.Exception
headerValue
-
java.lang.Exception
public void parseCredentials() throws java.lang.Exception
java.lang.Exception
public java.lang.String getAuthorizationUsername()
public java.lang.String getAuthorizationPassword()
public long numberOfBytesParsed()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |