public interface IRequest
Modifier and Type | Field and Description |
---|---|
static String |
RECENT_POSTBACK_COOKIE |
Modifier and Type | Method and Description |
---|---|
String |
getActualIp()
Tries to guess the actual IP address of the end-user, by looking at the
IP address header as defined in settings.ipHeaderName (x-real-ip by default) and
then getRemoteAddr() if the header does not exist.
|
Map<String,Object> |
getBodyMap()
Parse the request body based on the content-type, usually either form encoded or JSON,
and then parse it into a Map
|
Object |
getBodyObject(Class clazz)
Interpret the body of the request as JSON and parse it into the given object.
|
Object |
getBodyParam(String name)
Internally, gets the request body as Map, and then returns the value for the given key
|
String |
getContent()
Gets the request body as a string
|
javax.servlet.http.Cookie |
getCookie(String cookieName) |
javax.servlet.http.Cookie[] |
getCookies() |
String |
getHeader(String name)
Get the given request header, case insensitive
|
Enumeration<String> |
getHeaderNames() |
String |
getHost()
Gets the host by first looking for the x-forwarded-for header, and then
the Host: header.
|
default javax.servlet.http.HttpServletRequest |
getHttpServletRequest() |
Boolean |
getIsJsonRequest()
Returns true if this request is expected to produce JSON, used to determine
what kind of response to give in cases of errors.
|
Map<String,Object> |
getItems()
Get an arbitrary hashmap of data that lives the lifetime of this request,
can be used as a very short lived cache, or for any other arbitrary use.
|
String |
getMethod()
Gets the HTTP method - GET, POST, PUT, DELETE, etc.
|
IOrg |
getOrg() |
String |
getParameter(String paramName)
Gets the parameter from either the query string or the request body
|
default javax.servlet.http.Part |
getPart(String name) |
String |
getPath()
Get the request path
|
default List<String> |
getQueryParamAsList(String key) |
Map<String,String> |
getQueryParams()
Parses the query string into a map
|
String |
getQueryString()
Get the request query string, everything after the ? in the URL
|
BufferedReader |
getReader()
Get a Reader that reads the request body
|
String |
getRemoteAddr()
Get the RemoteAddr field from the underlying HttpServletRequest object,
which gets it from the socket connection.
|
default URI |
getRequestUri() |
default String |
getRequestUrl()
Alis for requestUrl()
|
default String |
getRequestUrlWithQuery()
Absolute URL of the request with the query string.
|
SandboxedRequest |
getSandboxedRequest(Sandbox box)
Get a sandboxed version of this request object.
|
String |
getScheme() |
Set<String> |
getScopes()
If this is a scoped, OAuth request, return the scopes.
|
IUser |
getUser()
Gets the user associated with the current request
|
boolean |
isScoped()
Return true if this is scope-limited OAuth request
|
String |
requestUrl()
Get the full, externally facing URL used to intiate this request.
|
default void |
setAsMultiPartRequest() |
void |
setIsJsonRequest(Boolean isJsonRequest) |
void |
setItems(Map<String,Object> items) |
void |
setOrg(IOrg org) |
void |
setPath(String path) |
void |
setQuery(String query) |
IRequest |
setScoped(boolean scoped) |
IRequest |
setScopes(Set<String> scopes) |
void |
setUser(IUser user) |
static final String RECENT_POSTBACK_COOKIE
default void setAsMultiPartRequest()
default javax.servlet.http.HttpServletRequest getHttpServletRequest()
String requestUrl()
default String getRequestUrl()
default URI getRequestUri()
default String getRequestUrlWithQuery()
String getQueryString()
default List<String> getQueryParamAsList(String key)
String getRemoteAddr()
String getHost()
String getActualIp()
Object getBodyObject(Class clazz)
clazz
- Map<String,Object> getBodyMap()
Object getBodyParam(String name)
name
- Map<String,String> getQueryParams()
javax.servlet.http.Cookie[] getCookies()
String getHeader(String name)
name
- BufferedReader getReader() throws IOException
IOException
String getContent()
Enumeration<String> getHeaderNames()
String getParameter(String paramName)
paramName
- Boolean getIsJsonRequest()
void setIsJsonRequest(Boolean isJsonRequest)
Map<String,Object> getItems()
SandboxedRequest getSandboxedRequest(Sandbox box)
box
- boolean isScoped()
Copyright © 2016. All rights reserved.