Package com.mendix.m2ee.api
Interface IMxRuntimeRequest
public interface IMxRuntimeRequest
This interface represents a request coming in to the runtime.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]This method is only here for backwards compatibility and should not be used.Deprecated, for removal: This API element is subject to removal in a future version.since 10.18.Returns the value of the cookie.Returns the value of the cookie.Returns the name of the file.Returns the file as a binary data stream.Returns the value of a header.Returns the names of the headers in this request.javax.servlet.http.HttpServletRequestReturns the HttpServletRequest underlying this runtime request.Returns the body of the request as a binary data stream.getParameter(String paramName) Returns the parameter value.Returns the IP address of the client that sent the request.Returns the request serialized as a string.Returns the extra path information of this request.Returns the root URL of the application, based on the `ApplicationRootUrl` configuration setting and the request headers.booleanReturns true if this request is a file upload.
-
Method Details
-
getRequestString
String getRequestString()Returns the request serialized as a string.- Returns:
- the string representation of the request.
-
getParameter
Returns the parameter value.- Parameters:
paramName- the parameter name.- Returns:
- the value of the parameter if it exists, null otherwise.
-
getCookie
Returns the value of the cookie.- Parameters:
cookieName- the name of the cookie.- Returns:
- the value of the cookie if it exists, null otherwise.
-
getCookie
Returns the value of the cookie.- Parameters:
cookieName- the name of the cookie.isHostOnly- prefix key with __Host-.- Returns:
- the value of the cookie if it exists, null otherwise.
-
isFileUpload
boolean isFileUpload()Returns true if this request is a file upload.- Returns:
- whether this request is a file upload.
-
getRemoteAddr
String getRemoteAddr()Returns the IP address of the client that sent the request.- Returns:
- the IP address.
-
getInputStream
Returns the body of the request as a binary data stream.- Returns:
- the body of the request.
- Throws:
IOException- if an input or output exception occurs.
-
getFileItemStream
Returns the file as a binary data stream.- Returns:
- the binary data stream.
- Throws:
RuntimeException- if the request is not a file upload.IOException
-
getFileItemName
String getFileItemName()Returns the name of the file.- Returns:
- the name of the file.
- Throws:
RuntimeException- if the request is not a file upload.
-
getResourcePath
String getResourcePath()Returns the extra path information of this request.For example when the full URL is http://www.example.com/web/ui/index.htm, it returns /web/ui/index.html.
- Returns:
- the extra path information.
-
getRootUrl
String getRootUrl()Returns the root URL of the application, based on the `ApplicationRootUrl` configuration setting and the request headers.When `ApplicationRootUrl` is defined, its value is returned. Otherwise, this method tries to create a complete URL from X-Forwarded-* headers. If this is not possible, it falls back to the `Host` header and the `HttpServletRequest.isSecure` property. `X-Forwarded-Proto` is given priority over `X-Forwarded-Scheme`. `X-Forwarded-Host` is given priority over `X-Forwarded-Port`.
- Returns:
- the root URL of the application.
- Throws:
RuntimeException- if no root URL can be determined.
-
getHeader
Returns the value of a header.- Parameters:
header- the header name.- Returns:
- the value of the header.
-
getHeaderNames
Enumeration<String> getHeaderNames()Returns the names of the headers in this request.- Returns:
- the names of the headers.
-
getContext
Deprecated, for removal: This API element is subject to removal in a future version.since 10.18. This method will be removed in Mendix 11. There is no replacement.Returns the AppContainer corresponding to this request.- Returns:
- the AppContainer for this request.
-
getHttpServletRequest
javax.servlet.http.HttpServletRequest getHttpServletRequest()Returns the HttpServletRequest underlying this runtime request.- Returns:
- the underlying HttpServletRequest.
-
createFingerprint
byte[] createFingerprint()This method is only here for backwards compatibility and should not be used.- Returns:
- the fingerprint.
-