public class StRequest extends Object implements IRequest
RECENT_POSTBACK_COOKIE| Constructor and Description |
|---|
StRequest() |
StRequest(String path,
org.eclipse.jetty.server.Request baseRequest,
javax.servlet.http.HttpServletRequest request) |
| 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.
|
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
|
javax.servlet.http.Part |
getPart(String name) |
String |
getPath()
Get the request path
|
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.
|
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
|
String |
getValetEmail() |
Long |
getValetUserId() |
boolean |
isScoped()
Return true if this is scope-limited OAuth request
|
String |
requestUrl()
Gets the absolute url of the original request.
|
void |
setAsMultiPartRequest() |
void |
setIsJsonRequest(Boolean isJsonRequest) |
void |
setItems(Map<String,Object> items) |
void |
setOrg(IOrg org) |
void |
setPath(String path) |
void |
setQuery(String query) |
StRequest |
setScoped(boolean scoped) |
StRequest |
setScopes(Set<String> scopes) |
void |
setUser(IUser user) |
StRequest |
setValetEmail(String valetEmail) |
StRequest |
setValetUserId(Long valetUserId) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetQueryParamAsList, getRequestUri, getRequestUrl, getRequestUrlWithQuerypublic StRequest()
public void setAsMultiPartRequest()
setAsMultiPartRequest in interface IRequestpublic javax.servlet.http.HttpServletRequest getHttpServletRequest()
getHttpServletRequest in interface IRequestpublic String requestUrl()
requestUrl in interface IRequestpublic String getHost()
IRequestpublic String getQueryString()
IRequestgetQueryString in interface IRequestpublic String getRemoteAddr()
IRequestgetRemoteAddr in interface IRequestpublic String getActualIp()
IRequestgetActualIp in interface IRequestpublic Object getBodyObject(Class clazz)
IRequestgetBodyObject in interface IRequestpublic Map<String,Object> getBodyMap()
IRequestgetBodyMap in interface IRequestpublic Object getBodyParam(String name)
IRequestgetBodyParam in interface IRequestpublic Map<String,String> getQueryParams()
IRequestgetQueryParams in interface IRequestpublic javax.servlet.http.Cookie[] getCookies()
getCookies in interface IRequestpublic String getHeader(String name)
IRequestpublic BufferedReader getReader() throws IOException
IRequestgetReader in interface IRequestIOExceptionpublic String getContent()
IRequestgetContent in interface IRequestpublic Enumeration<String> getHeaderNames()
getHeaderNames in interface IRequestpublic IUser getUser()
IRequestpublic String getMethod()
IRequestpublic String getParameter(String paramName)
IRequestgetParameter in interface IRequestpublic Boolean getIsJsonRequest()
IRequestgetIsJsonRequest in interface IRequestpublic void setIsJsonRequest(Boolean isJsonRequest)
setIsJsonRequest in interface IRequestpublic Map<String,Object> getItems()
IRequestpublic SandboxedRequest getSandboxedRequest(Sandbox box)
IRequestgetSandboxedRequest in interface IRequestpublic Set<String> getScopes()
IRequestpublic boolean isScoped()
IRequestpublic Long getValetUserId()
public StRequest setValetUserId(Long valetUserId)
public String getValetEmail()
public StRequest setValetEmail(String valetEmail)
Copyright © 2016. All rights reserved.