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 https://developer.mozilla.org/en-US/docs/Web/HTTP/HeadersrequestBody
- 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.
-
-
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
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers- Returns:
- Value if it is present in the request.
-
omitFirstInPath
-
toString
-