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:
AttributeHolder,MutableAttributeHolder,HttpMessage<B>,HttpRequest<B>
- Direct Known Subclasses:
MutableHttpRequestWrapper
A wrapper around a
HttpRequest.- Since:
- 1.0
- Author:
- Graeme Rocher
-
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()Get the SSL session used for the connection to the client, if available.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) Sets an attribute on the message.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, mutate, setUserPrincipal, toMutableRequestMethods 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
Description copied from interface:MutableAttributeHolderSets an attribute on the message.- Specified by:
setAttributein interfaceHttpMessage<B>- Specified by:
setAttributein interfaceHttpRequest<B>- Specified by:
setAttributein interfaceMutableAttributeHolder- Parameters:
name- The name of the attributevalue- The value of the attribute- Returns:
- This message
-
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.
-
getSslSession
Description copied from interface:HttpRequestGet the SSL session used for the connection to the client, if available.- Specified by:
getSslSessionin interfaceHttpRequest<B>- Returns:
- The session
-
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
-