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 typeREQ- The POJA request typeRES- 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> 
- Direct Known Subclasses:
 ApacheServletHttpRequest
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 Summary
Nested classes/interfaces inherited from interface io.micronaut.servlet.http.ServletHttpRequest
ServletHttpRequest.AsyncExecution, ServletHttpRequest.AsyncExecutionCallback - 
Field Summary
FieldsModifier 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>protected final PojaHttpResponse<?,RES> Fields inherited from interface io.micronaut.http.HttpRequest
SCHEME_HTTP, SCHEME_HTTPS - 
Constructor Summary
ConstructorsConstructorDescriptionPojaHttpRequest(io.micronaut.core.convert.ConversionService conversionService, io.micronaut.http.codec.MediaTypeCodecRegistry codecRegistry, PojaHttpResponse<?, RES> response)  - 
Method Summary
Modifier 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.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.core.convert.ConversionServiceAware
setConversionServiceMethods inherited from interface io.micronaut.http.HttpMessage
getBody, getBody, getBody, getBodyWriter, getCharacterEncoding, getContentLength, getContentTypeMethods inherited from interface io.micronaut.http.HttpRequest
accept, getCertificate, getCookies, getHttpVersion, getLocale, getMethod, getMethodName, getOrigin, getPath, getRemoteAddress, getServerAddress, getServerName, getSslSession, getUri, getUserPrincipal, getUserPrincipal, isSecure, mutate, setAttributeMethods inherited from interface io.micronaut.core.attr.MutableAttributeHolder
removeAttributeMethods inherited from interface io.micronaut.http.MutableHttpMessage
bodyWriterMethods inherited from interface io.micronaut.http.MutableHttpRequest
accept, 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.ServletHttpRequest
executeAsync, getContextPath, getNativeRequest, isAsyncSupported 
- 
Field Details
- 
CONVERTIBLE_VALUES_ARGUMENT
public static final io.micronaut.core.type.Argument<io.micronaut.core.convert.value.ConvertibleValues> CONVERTIBLE_VALUES_ARGUMENT - 
conversionService
protected final io.micronaut.core.convert.ConversionService conversionService - 
codecRegistry
protected final io.micronaut.http.codec.MediaTypeCodecRegistry codecRegistry - 
attributes
 - 
response
 
 - 
 - 
Constructor Details
- 
PojaHttpRequest
public PojaHttpRequest(io.micronaut.core.convert.ConversionService conversionService, io.micronaut.http.codec.MediaTypeCodecRegistry codecRegistry, PojaHttpResponse<?, RES> response)  
 - 
 - 
Method Details
- 
byteBody
public abstract io.micronaut.http.body.ByteBody byteBody()- Specified by:
 byteBodyin interfaceio.micronaut.http.ServerHttpRequest<B>
 - 
getAttributes
@NonNull public @NonNull io.micronaut.core.convert.value.MutableConvertibleValues<Object> getAttributes()- Specified by:
 getAttributesin interfaceio.micronaut.core.attr.AttributeHolder- Specified by:
 getAttributesin interfaceio.micronaut.http.HttpMessage<B>- Specified by:
 getAttributesin interfaceio.micronaut.core.attr.MutableAttributeHolder
 - 
consumeBody
A 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 interfaceio.micronaut.http.HttpMessage<B>
 - 
getFormData
A method used for retrieving form data. Can be overridden by specific implementations.- Returns:
 - The form data as multi-values.
 
 - 
getInputStream
Description 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 interfaceServletHttpRequest<B,REQ> - Returns:
 - The input stream
 
 - 
getReader
Description copied from interface:ServletHttpRequestReturns aBufferedReaderthat can be used to read the text body of this HTTP request.- Specified by:
 getReaderin interfaceServletHttpRequest<B,REQ> - Returns:
 - The reader
 
 - 
isFormSubmission
public boolean isFormSubmission()Whether the request body is a form.- Returns:
 - Whether it is a form submission
 
 - 
getRequest
- Specified by:
 getRequestin interfaceServletExchange<B,REQ> - Returns:
 - The request object
 
 - 
getResponse
- Specified by:
 getResponsein interfaceServletExchange<B,REQ> - Returns:
 - The response object
 
 
 -