Class Request
java.lang.Object
com.djrapitops.plan.delivery.web.resolver.request.Request
Represents a HTTP request to use with
Resolver.-
Constructor Summary
ConstructorsConstructorDescriptionRequest(String method, URIPath path, URIQuery query, WebUser user, Map<String, String> headers, byte[] requestBody) Deprecated.Use newer constructor with IP address.Request(String method, URIPath path, URIQuery query, WebUser user, Map<String, String> headers, byte[] requestBody, String accessIpAddress) Constructor.Deprecated.Use newer constructor with IP address.Request(String method, String target, WebUser user, Map<String, String> headers, String accessIpAddress) Special constructor that figures out URIPath and URIQuery from "/path/and?query=params" and has no request body. -
Method Summary
-
Constructor Details
-
Request
@Deprecated public Request(String method, URIPath path, URIQuery query, WebUser user, Map<String, String> headers, byte[] requestBody) Deprecated.Use newer constructor with IP address.Constructor.- Parameters:
method- HTTP method, GET, PUT, POST, etcpath- Requested path /example/targetquery- Request parameters ?param=value etcuser- Web user doing the request (if authenticated)headers- Request headers DocumentationrequestBody- Raw body as bytes, if present
-
Request
public Request(String method, URIPath path, URIQuery query, WebUser user, Map<String, String> headers, byte[] requestBody, String accessIpAddress) Constructor.- Parameters:
method- HTTP method, GET, PUT, POST, etcpath- Requested path /example/targetquery- Request parameters ?param=value etcuser- Web user doing the request (if authenticated)headers- Request headers DocumentationrequestBody- Raw body as bytes, if presentaccessIpAddress- IP address this request is coming from.
-
Request
Deprecated.Use newer constructor with IP address.Special constructor that figures out URIPath and URIQuery from "/path/and?query=params" and has no request body.- Parameters:
method- HTTP request methodtarget- The requested path and query, e.g. "/path/and?query=params"user- User that made the requestheaders- HTTP request headers
-
Request
public Request(String method, String target, WebUser user, Map<String, String> headers, String accessIpAddress) Special constructor that figures out URIPath and URIQuery from "/path/and?query=params" and has no request body.- Parameters:
method- HTTP request methodtarget- The requested path and query, e.g. "/path/and?query=params"user- User that made the requestheaders- HTTP request headersaccessIpAddress- IP address this request is coming from.
-
-
Method Details
-
getMethod
Get HTTP method.- Returns:
- GET, PUT, POST, etc
-
getPath
Get the Requested path.- Returns:
URIPath.
-
getQuery
Get the Request parameters.- Returns:
URIQuery.
-
getRequestBody
public byte[] getRequestBody()Get the raw body, if present.- Returns:
- byte[].
-
getUser
Get the user making the request.- Returns:
- the user if authentication is enabled
-
getHeader
Get a header in the request.- Parameters:
key- Documentation- Returns:
- Value if it is present in the request.
-
omitFirstInPath
-
getAccessIpAddress
-
toString
-