public abstract class AbstractWebRequest extends java.lang.Object implements WebRequest
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
address |
protected int |
contentLength |
protected java.lang.String |
contentType |
protected java.util.LinkedHashMap<java.lang.String,java.lang.String> |
headers |
protected java.lang.String |
method |
protected boolean |
multipart |
protected java.lang.String |
path |
protected java.lang.String |
protocol |
protected java.lang.String |
query |
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.Object |
getInternalObject()
Returns the internal object of this WebRequest.
|
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 |
getProtocol()
Returns the name and version of the protocol the request uses in the form
protocol/majorVersion.minorVersion, for example, HTTP/1.1.
|
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 protocol
protected final java.lang.String path
protected final java.lang.String query
protected final java.lang.String method
protected final int contentLength
protected final java.lang.String contentType
protected final boolean multipart
protected final java.lang.String address
protected final java.util.LinkedHashMap<java.lang.String,java.lang.String> headers
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 java.lang.String getProtocol()
SERVER_PROTOCOL.getProtocol in interface WebRequestString containing the protocol name and version
numberpublic boolean isMultipart()
isMultipart in interface WebRequestpublic java.lang.Object getInternalObject()
getInternalObject in interface WebRequest