Class Request
java.lang.Object
com.djrapitops.plan.delivery.web.resolver.request.Request
Represents a HTTP request to use with
Resolver
.-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Request
public Request(String method, URIPath path, URIQuery query, WebUser user, Map<String, String> headers, byte[] requestBody) 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
Special constructor that figures out URIPath and URIQuery from "/path/and?query=params" and has no request body.- Parameters:
method
- HTTP requst methodtarget
- The requested path and query, e.g. "/path/and?query=params"user
- User that made the requestheaders
- HTTP request headers
-
-
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
-
toString
-