public abstract class AbstractWebRequest extends java.lang.Object implements WebRequest
| Modifier and Type | Field and Description |
|---|---|
protected int |
contentLength |
protected java.lang.String |
contentType |
protected java.lang.String |
method |
protected boolean |
multipart |
protected javax.servlet.http.HttpServletRequest |
req |
protected services.moleculer.stream.PacketStream |
stream |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractWebRequest(javax.servlet.http.HttpServletRequest req) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAddress()
Returns the Internet Protocol (IP) address of the client or last proxy
that sent the request.
|
services.moleculer.stream.PacketStream |
getBody()
Returns the request body as PacketStream.
|
int |
getContentLength()
Returns the length, in bytes, of the request body and made available by
the input stream, or -1 if the length is not known ir is greater than
Integer.MAX_VALUE.
|
java.lang.String |
getContentType()
Returns the MIME type of the body of the request, or null if the type is
not known.
|
java.lang.String |
getHeader(java.lang.String name)
Returns the value of the specified request header as a String.
|
java.util.Iterator<java.lang.String> |
getHeaders()
Returns an iterator of all the header names this request contains.
|
java.lang.String |
getMethod()
Returns the name of the HTTP method with which this request was made, for
example, GET, POST, or PUT.
|
java.lang.String |
getPath()
Returns any extra path information associated with the URL the client
sent when it made this request.
|
java.lang.String |
getQuery()
Returns the query string that is contained in the request URL after the
path.
|
boolean |
isMultipart()
Checks if the Content-Type header defines a multipart request.
|
protected final javax.servlet.http.HttpServletRequest req
protected final java.lang.String method
protected final int contentLength
protected final java.lang.String contentType
protected final boolean multipart
protected services.moleculer.stream.PacketStream stream
protected AbstractWebRequest(javax.servlet.http.HttpServletRequest req)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getAddress()
getAddress in interface WebRequestpublic java.lang.String getMethod()
getMethod in interface WebRequestpublic java.lang.String getPath()
getPath in interface WebRequestpublic java.lang.String getQuery()
getQuery in interface WebRequestpublic int getContentLength()
getContentLength in interface WebRequestpublic java.lang.String getContentType()
getContentType in interface WebRequestpublic services.moleculer.stream.PacketStream getBody()
getBody in interface WebRequestpublic java.lang.String getHeader(java.lang.String name)
getHeader in interface WebRequestname - name a String specifying the header namepublic java.util.Iterator<java.lang.String> getHeaders()
getHeaders in interface WebRequestpublic boolean isMultipart()
isMultipart in interface WebRequest