Package io.micronaut.http
Class HttpRequestWrapper<B>
java.lang.Object
io.micronaut.http.HttpMessageWrapper<B>
io.micronaut.http.HttpRequestWrapper<B>
- Type Parameters:
B- The Http body type
- All Implemented Interfaces:
io.micronaut.core.attr.AttributeHolder,io.micronaut.core.attr.MutableAttributeHolder,HttpMessage<B>,HttpRequest<B>
A wrapper around a
HttpRequest.- Since:
- 1.0
-
Field Summary
Fields inherited from interface io.micronaut.http.HttpRequest
SCHEME_HTTP, SCHEME_HTTPS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccept()A list of acceptedMediaTypeinstances sorted by their quality rating.Retrieves the Certificate used for mutual authentication.getPath()getUri()The user principal stored within the request.getUserPrincipal(Class<T> principalType) The user principal stored within the request.booleanisSecure()setAttribute(CharSequence name, Object value) Methods inherited from class io.micronaut.http.HttpMessageWrapper
getAttributes, getBody, getBody, getBody, getBody, getHeadersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.core.attr.AttributeHolder
getAttribute, getAttributeMethods inherited from interface io.micronaut.http.HttpMessage
getAttributes, getBody, getBody, getBody, getBody, getBodyWriter, getCharacterEncoding, getContentLength, getContentType, getHeadersMethods inherited from interface io.micronaut.http.HttpRequest
getOrigin, mutateMethods inherited from interface io.micronaut.core.attr.MutableAttributeHolder
removeAttribute
-
Constructor Details
-
HttpRequestWrapper
- Parameters:
delegate- The Http Request
-
-
Method Details
-
getDelegate
- Overrides:
getDelegatein classHttpMessageWrapper<B>- Returns:
- The Http message
-
getHttpVersion
- Specified by:
getHttpVersionin interfaceHttpRequest<B>- Returns:
- The http version of the request.
-
accept
Description copied from interface:HttpRequestA list of acceptedMediaTypeinstances sorted by their quality rating.- Specified by:
acceptin interfaceHttpRequest<B>- Returns:
- A list of zero or many
MediaTypeinstances
-
getUserPrincipal
Description copied from interface:HttpRequestThe user principal stored within the request.- Specified by:
getUserPrincipalin interfaceHttpRequest<B>- Returns:
- The principal
-
getUserPrincipal
Description copied from interface:HttpRequestThe user principal stored within the request.- Specified by:
getUserPrincipalin interfaceHttpRequest<B>- Type Parameters:
T- The principal type- Parameters:
principalType- The principal type- Returns:
- The principal
-
setAttribute
- Specified by:
setAttributein interfaceHttpMessage<B>- Specified by:
setAttributein interfaceHttpRequest<B>- Specified by:
setAttributein interfaceio.micronaut.core.attr.MutableAttributeHolder
-
getLocale
- Specified by:
getLocalein interfaceHttpMessage<B>- Specified by:
getLocalein interfaceHttpRequest<B>- Returns:
- The locale of the message
-
getCertificate
Description copied from interface:HttpRequestRetrieves the Certificate used for mutual authentication.- Specified by:
getCertificatein interfaceHttpRequest<B>- Returns:
- A certificate used for authentication, if applicable.
-
getCookies
- Specified by:
getCookiesin interfaceHttpRequest<B>- Returns:
- The
Cookiesinstance
-
getParameters
- Specified by:
getParametersin interfaceHttpRequest<B>- Returns:
- The HTTP parameters contained with the URI query string
-
getMethod
- Specified by:
getMethodin interfaceHttpRequest<B>- Returns:
- The request method
-
getMethodName
- Specified by:
getMethodNamein interfaceHttpRequest<B>- Returns:
- The name of the method (same as
HttpMethodvalue for standard http methods).
-
getUri
- Specified by:
getUriin interfaceHttpRequest<B>- Returns:
- The full request URI
-
getPath
- Specified by:
getPathin interfaceHttpRequest<B>- Returns:
- Get the raw, percent-encoded path without any parameters
-
getRemoteAddress
- Specified by:
getRemoteAddressin interfaceHttpRequest<B>- Returns:
- Obtain the remote address
-
getServerAddress
- Specified by:
getServerAddressin interfaceHttpRequest<B>- Returns:
- Obtain the server address
-
getServerName
- Specified by:
getServerNamein interfaceHttpRequest<B>- Returns:
- The server host name
-
isSecure
public boolean isSecure()- Specified by:
isSecurein interfaceHttpRequest<B>- Returns:
- Is the request an HTTPS request
-