Class RequestContext
java.lang.Object
com.inductiveautomation.ignition.gateway.dataroutes.RequestContext
Wrapper around an HttpServletRequest to include some helpful data for
RouteHandler
instances.-
Constructor Summary
ConstructorsConstructorDescriptionRequestContext
(jakarta.servlet.http.HttpServletRequest request, String path) -
Method Summary
Modifier and TypeMethodDescriptiongetActor()
Convenience method to try and find a reasonable representation for the "actor" who is making the request.Returns the HttpMethod of the requestgetParameter
(String name) Fetch a named parameter.getPath()
Returns the URL path that that matched the route.jakarta.servlet.http.HttpServletRequest
The underlying web requestcom.google.common.collect.ImmutableCollection<String>
void
putParameter
(String name, String value) readBody()
-
Constructor Details
-
RequestContext
-
-
Method Details
-
getGatewayContext
-
getRequest
public jakarta.servlet.http.HttpServletRequest getRequest()The underlying web request -
getPath
Returns the URL path that that matched the route. This will not include /data/module/ -
getMethod
Returns the HttpMethod of the request -
readBody
- Throws:
IOException
-
getParameter
Fetch a named parameter. First this will match any parameters that were part of the route's named parameters. For example, if your route was /widgets/:id you may call getParameter("id") and it will return the value from the request URL that matched the :id parameter.
If it does not match a route parameter, it will delegate to the internal HttpServletRequest's parameter map, which comes from the URL's query string or post parameters.
-
putParameter
-
getRequestUri
- Returns:
- the full URI for this HTTP Request (example: http://example.com:8088/foo/bar?baz=abc)
-
getRelativeRequestUri
- Returns:
- the relative URI for this HTTP Request (example: /foo/bar?baz=abc)
-
getActor
Convenience method to try and find a reasonable representation for the "actor" who is making the request. Will ask the WebUiSession, then the ApiTokenManager, then the SecurityZoneAccessControlStrategy in that order to provide an actor string, and will return "unknown" if none of them can provide one. -
getSecurityZones
-