Package io.micronaut.http.client.netty
Class FullNettyClientHttpResponse<B>
java.lang.Object
io.micronaut.http.client.netty.FullNettyClientHttpResponse<B>
- Type Parameters:
B- The response type
- All Implemented Interfaces:
AttributeHolder,MutableAttributeHolder,HttpMessage<B>,HttpResponse<B>,NettyHttpResponseBuilder
@Internal
public class FullNettyClientHttpResponse<B>
extends Object
implements HttpResponse<B>, NettyHttpResponseBuilder
Wraps a Netty
FullHttpResponse for consumption by the HttpClient.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Method Summary
Modifier and TypeMethodDescriptionintcode()AMutableConvertibleValuesof the attributes for this HTTP message.getBody()Return the body as the given type.Return the body as the given type.Helper method for retrieving a single Cookie on a response.Helper method for retrieving all Cookies on a response.booleanisStream()reason()@NonNull io.netty.handler.codec.http.FullHttpResponseConverts this object to a full http response.io.netty.handler.codec.http.HttpResponseConverts this object to the most appropriate http response type.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.http.HttpMessage
getBody, getBodyWriter, getCharacterEncoding, getContentLength, getContentType, getLocaleMethods inherited from interface io.micronaut.http.HttpResponse
body, getStatus, header, setAttribute, status, toMutableResponseMethods inherited from interface io.micronaut.core.attr.MutableAttributeHolder
removeAttributeMethods inherited from interface io.micronaut.http.netty.NettyHttpResponseBuilder
toStreamHttpResponse
-
Method Details
-
reason
- Specified by:
reasonin interfaceHttpResponse<B>- Returns:
- The HTTP status reason phrase
-
code
public int code()- Specified by:
codein interfaceHttpResponse<B>- Returns:
- The response status code
-
getHeaders
- Specified by:
getHeadersin interfaceHttpMessage<B>- Returns:
- The
HttpHeadersobject
-
getCookies
Description copied from interface:HttpResponseHelper method for retrieving all Cookies on a response.- Specified by:
getCookiesin interfaceHttpResponse<B>- Returns:
- The cookies on the response
-
getCookie
Description copied from interface:HttpResponseHelper method for retrieving a single Cookie on a response.- Specified by:
getCookiein interfaceHttpResponse<B>- Parameters:
name- The name of the Cookie- Returns:
- The Cookie
-
getAttributes
Description copied from interface:HttpMessageA
MutableConvertibleValuesof the attributes for this HTTP message.Attributes are designed for internal data sharing and hence are isolated from headers and parameters which are client supplied
- Specified by:
getAttributesin interfaceAttributeHolder- Specified by:
getAttributesin interfaceHttpMessage<B>- Specified by:
getAttributesin interfaceMutableAttributeHolder- Returns:
- The attributes of the message
-
getBody
- Specified by:
getBodyin interfaceHttpMessage<B>- Returns:
- The request body
-
getBody
Description copied from interface:HttpMessageReturn the body as the given type.- Specified by:
getBodyin interfaceHttpMessage<B>- Type Parameters:
T- The generic type- Parameters:
type- The type of the body- Returns:
- An
Optionalof the type orOptional.empty()if the body cannot be returned as the given type
-
getBody
Description copied from interface:HttpMessageReturn the body as the given type.- Specified by:
getBodyin interfaceHttpMessage<B>- Type Parameters:
T- The generic type- Parameters:
type- The type of the body- Returns:
- An
Optionalof the type orOptional.empty()if the body cannot be returned as the given type
-
toFullHttpResponse
Description copied from interface:NettyHttpResponseBuilderConverts this object to a full http response.- Specified by:
toFullHttpResponsein interfaceNettyHttpResponseBuilder- Returns:
- a full http response
-
toHttpResponse
Description copied from interface:NettyHttpResponseBuilderConverts this object to the most appropriate http response type.- Specified by:
toHttpResponsein interfaceNettyHttpResponseBuilder- Returns:
- The http response
-
isStream
public boolean isStream()- Specified by:
isStreamin interfaceNettyHttpResponseBuilder- Returns:
- Is the response a stream.
-