Class Request
- java.lang.Object
-
- com.djrapitops.plan.delivery.web.resolver.request.Request
-
public final class Request extends java.lang.Object
Represents a HTTP request to use withResolver
.
-
-
Constructor Summary
Constructors Constructor Description Request(java.lang.String method, URIPath path, URIQuery query, WebUser user, java.util.Map<java.lang.String,java.lang.String> headers)
Constructor.Request(java.lang.String method, java.lang.String target, WebUser user, java.util.Map<java.lang.String,java.lang.String> headers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.lang.String>
getHeader(java.lang.String key)
Get a header in the request.java.lang.String
getMethod()
Get HTTP method.URIPath
getPath()
Get the Requested path.URIQuery
getQuery()
Get the Request parameters.java.util.Optional<WebUser>
getUser()
Get the user making the request.Request
omitFirstInPath()
java.lang.String
toString()
-
-
-
Constructor Detail
-
Request
public Request(java.lang.String method, URIPath path, URIQuery query, WebUser user, java.util.Map<java.lang.String,java.lang.String> headers)
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/Headers
-
Request
public Request(java.lang.String method, java.lang.String target, WebUser user, java.util.Map<java.lang.String,java.lang.String> headers)
-
-
Method Detail
-
getMethod
public java.lang.String getMethod()
Get HTTP method.- Returns:
- GET, PUT, POST, etc
-
getUser
public java.util.Optional<WebUser> getUser()
Get the user making the request.- Returns:
- the user if authentication is enabled
-
getHeader
public java.util.Optional<java.lang.String> getHeader(java.lang.String key)
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
public Request omitFirstInPath()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-