public final class TLfnEventSourceRequest extends Object
This class captures and retains some request information beyond the lifetime of the request.
This in contrast to HttpServletRequest
and TLcdHttpServletRequestKVPRequestWrapper
where this information could no longer be available when the HTTP request has been handled. This is useful, for example,
when working with events that are handled asynchronously. In an asynchronous event handler there is no guarantee that
the HTTP request is still in progress.
Modifier and Type | Method and Description |
---|---|
Optional<String> |
getBody()
Returns the JSON or XML body of this request.
|
Optional<String> |
getContentType()
Returns the MIME type of the body of the request, or
Optional.empty() if the type is not known. |
Map<String,String> |
getHeaders()
Returns a map containing the Http headers of the request.
|
String |
getHttpMethod()
Returns the HTTP method (GET, POST, PUT, DELETE, and so on) used to perform the request
|
URI |
getRequestUri()
Returns the
URI the client used to make the request. |
String |
toString() |
public String getHttpMethod()
public URI getRequestUri()
URI
the client used to make the request. The returned URI
contains a scheme, host, port number (if different from the standard HTTP(S) port), context path and query string.URI
the client used to make the request.public Optional<String> getContentType()
Optional.empty()
if the type is not known.String
containing the name of the MIME type
of the request, or Optional.empty()
if the type is not known.public Optional<String> getBody()
null
if the request does not contain a JSON or XML body.public Map<String,String> getHeaders()