Package io.micronaut.http.poja
Class PojaHttpRequest<B,REQ,RES>  
java.lang.Object
io.micronaut.http.poja.PojaHttpRequest<B,REQ,RES>  
- Type Parameters:
- B- The body type
- REQ- The POJA request type
- RES- The POJA response type
- All Implemented Interfaces:
- io.micronaut.core.attr.AttributeHolder,- io.micronaut.core.attr.MutableAttributeHolder,- io.micronaut.core.convert.ConversionServiceAware,- io.micronaut.http.HttpMessage<B>,- io.micronaut.http.HttpRequest<B>,- io.micronaut.http.MutableHttpMessage<B>,- io.micronaut.http.MutableHttpRequest<B>,- io.micronaut.http.ServerHttpRequest<B>,- ServletExchange<REQ,,- RES> - ServletHttpRequest<REQ,,- B> - Closeable,- AutoCloseable
- Direct Known Subclasses:
- ApacheServletHttpRequest
@Internal
public abstract class PojaHttpRequest<B,REQ,RES>  
extends Object
implements ServletHttpRequest<REQ,B>, io.micronaut.http.ServerHttpRequest<B>, ServletExchange<REQ,RES>, io.micronaut.http.MutableHttpRequest<B>  
A base class for serverless POJA requests that provides a number of common methods
 to be reused for body and binding.
- Since:
- 4.10.0
- Author:
- Andriy
- 
Nested Class SummaryNested classes/interfaces inherited from interface io.micronaut.servlet.http.ServletHttpRequestServletHttpRequest.AsyncExecution, ServletHttpRequest.AsyncExecutionCallback
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final io.micronaut.core.convert.value.MutableConvertibleValues<Object>protected final io.micronaut.http.codec.MediaTypeCodecRegistryprotected final io.micronaut.core.convert.ConversionServicestatic final io.micronaut.core.type.Argument<io.micronaut.core.convert.value.ConvertibleValues>Fields inherited from interface io.micronaut.http.HttpRequestSCHEME_HTTP, SCHEME_HTTPS
- 
Constructor SummaryConstructorsConstructorDescriptionPojaHttpRequest(io.micronaut.core.convert.ConversionService conversionService, io.micronaut.http.codec.MediaTypeCodecRegistry codecRegistry) 
- 
Method SummaryModifier and TypeMethodDescriptionabstract io.micronaut.http.body.ByteBodybyteBody()<T> TconsumeBody(Function<InputStream, T> consumer) A utility method that allows consuming body.@NonNull io.micronaut.core.convert.value.MutableConvertibleValues<Object><T> @NonNull Optional<T>getBody(@NonNull io.micronaut.core.convert.ArgumentConversionContext<T> conversionContext) protected io.micronaut.core.convert.value.ConvertibleMultiValues<CharSequence>A method used for retrieving form data.Returns anInputStreamthat can be used to read the body of this HTTP request.Returns aBufferedReaderthat can be used to read the text body of this HTTP request.ServletHttpRequest<REQ,? super Object> booleanWhether the request body is a form.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.core.attr.AttributeHoldergetAttribute, getAttributeMethods inherited from interface io.micronaut.core.convert.ConversionServiceAwaresetConversionServiceMethods inherited from interface io.micronaut.http.HttpMessagegetBody, getBody, getBody, getBodyWriter, getCharacterEncoding, getContentLength, getContentTypeMethods inherited from interface io.micronaut.http.HttpRequestaccept, getCertificate, getCookies, getHttpVersion, getLocale, getMethod, getMethodName, getOrigin, getPath, getRemoteAddress, getServerAddress, getServerName, getSslSession, getUri, getUserPrincipal, getUserPrincipal, isSecure, mutate, setAttribute, setUserPrincipalMethods inherited from interface io.micronaut.core.attr.MutableAttributeHolderremoveAttributeMethods inherited from interface io.micronaut.http.MutableHttpMessagebodyWriterMethods inherited from interface io.micronaut.http.MutableHttpRequestaccept, accept, basicAuth, bearerAuth, body, contentEncoding, contentLength, contentType, contentType, cookie, cookies, getHeaders, getParameters, header, headers, headers, toMutableRequest, uri, uriMethods inherited from interface io.micronaut.servlet.http.ServletExchangeclose, createResponse, getResponseMethods inherited from interface io.micronaut.servlet.http.ServletHttpRequestexecuteAsync, getContextPath, getNativeRequest, isAsyncSupported
- 
Field Details- 
CONVERTIBLE_VALUES_ARGUMENTpublic static final io.micronaut.core.type.Argument<io.micronaut.core.convert.value.ConvertibleValues> CONVERTIBLE_VALUES_ARGUMENT
- 
conversionServiceprotected final io.micronaut.core.convert.ConversionService conversionService
- 
codecRegistryprotected final io.micronaut.http.codec.MediaTypeCodecRegistry codecRegistry
- 
attributes
 
- 
- 
Constructor Details- 
PojaHttpRequestpublic PojaHttpRequest(io.micronaut.core.convert.ConversionService conversionService, io.micronaut.http.codec.MediaTypeCodecRegistry codecRegistry) 
 
- 
- 
Method Details- 
byteBodypublic abstract io.micronaut.http.body.ByteBody byteBody()- Specified by:
- byteBodyin interface- io.micronaut.http.ServerHttpRequest<B>
 
- 
getAttributes@NonNull public @NonNull io.micronaut.core.convert.value.MutableConvertibleValues<Object> getAttributes()- Specified by:
- getAttributesin interface- io.micronaut.core.attr.AttributeHolder
- Specified by:
- getAttributesin interface- io.micronaut.http.HttpMessage<B>
- Specified by:
- getAttributesin interface- io.micronaut.core.attr.MutableAttributeHolder
 
- 
consumeBodyA utility method that allows consuming body.- Type Parameters:
- T- The function return value
- Parameters:
- consumer- The method to consume the body
- Returns:
- The result
 
- 
getBody@NonNull public <T> @NonNull Optional<T> getBody(@NonNull @NonNull io.micronaut.core.convert.ArgumentConversionContext<T> conversionContext) - Specified by:
- getBodyin interface- io.micronaut.http.HttpMessage<B>
 
- 
getFormDataA method used for retrieving form data. Can be overridden by specific implementations.- Returns:
- The form data as multi-values.
 
- 
getInputStreamDescription copied from interface:ServletHttpRequestReturns anInputStreamthat can be used to read the body of this HTTP request. This method is typically used to read binary data. If the body is text, theServletHttpRequest.getReader()method is more appropriate.- Specified by:
- getInputStreamin interface- ServletHttpRequest<B,- REQ> 
- Returns:
- The input stream
 
- 
getReaderDescription copied from interface:ServletHttpRequestReturns aBufferedReaderthat can be used to read the text body of this HTTP request.- Specified by:
- getReaderin interface- ServletHttpRequest<B,- REQ> 
- Returns:
- The reader
 
- 
isFormSubmissionpublic boolean isFormSubmission()Whether the request body is a form.- Returns:
- Whether it is a form submission
 
- 
getRequest- Specified by:
- getRequestin interface- ServletExchange<B,- REQ> 
- Returns:
- The request object
 
 
-