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:
Completable
,AttributeHolder
,MutableAttributeHolder
,HttpMessage<B>
,HttpResponse<B>
,NettyHttpResponseBuilder
@Internal
public class FullNettyClientHttpResponse<B>
extends Object
implements HttpResponse<B>, Completable, NettyHttpResponseBuilder
Wraps a Netty
FullHttpResponse
for consumption by the HttpClient
.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Method Summary
Modifier and TypeMethodDescriptionint
code()
AMutableConvertibleValues
of the attributes for this HTTP message.getBody()
<T> Optional<T>
Return the body as the given type.<T> Optional<T>
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.boolean
isStream()
void
* Successful terminal state.reason()
@NonNull io.netty.handler.codec.http.FullHttpResponse
Converts this object to a full http response.io.netty.handler.codec.http.HttpResponse
Converts 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, wait
Methods inherited from interface io.micronaut.core.attr.AttributeHolder
getAttribute, getAttribute
Methods inherited from interface io.micronaut.http.HttpMessage
getBody, getBodyWriter, getCharacterEncoding, getContentLength, getContentType, getLocale
Methods inherited from interface io.micronaut.http.HttpResponse
body, getStatus, header, setAttribute, status, toMutableResponse
Methods inherited from interface io.micronaut.core.attr.MutableAttributeHolder
removeAttribute
Methods inherited from interface io.micronaut.http.netty.NettyHttpResponseBuilder
toStreamHttpResponse
-
Method Details
-
reason
- Specified by:
reason
in interfaceHttpResponse<B>
- Returns:
- The HTTP status reason phrase
-
code
public int code()- Specified by:
code
in interfaceHttpResponse<B>
- Returns:
- The response status code
-
getHeaders
- Specified by:
getHeaders
in interfaceHttpMessage<B>
- Returns:
- The
HttpHeaders
object
-
getCookies
Description copied from interface:HttpResponse
Helper method for retrieving all Cookies on a response.- Specified by:
getCookies
in interfaceHttpResponse<B>
- Returns:
- The cookies on the response
-
getCookie
Description copied from interface:HttpResponse
Helper method for retrieving a single Cookie on a response.- Specified by:
getCookie
in interfaceHttpResponse<B>
- Parameters:
name
- The name of the Cookie- Returns:
- The Cookie
-
getAttributes
Description copied from interface:HttpMessage
A
MutableConvertibleValues
of 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:
getAttributes
in interfaceAttributeHolder
- Specified by:
getAttributes
in interfaceHttpMessage<B>
- Specified by:
getAttributes
in interfaceMutableAttributeHolder
- Returns:
- The attributes of the message
-
getBody
- Specified by:
getBody
in interfaceHttpMessage<B>
- Returns:
- The request body
-
getBody
Description copied from interface:HttpMessage
Return the body as the given type.- Specified by:
getBody
in interfaceHttpMessage<B>
- Type Parameters:
T
- The generic type- Parameters:
type
- The type of the body- Returns:
- An
Optional
of the type orOptional.empty()
if the body cannot be returned as the given type
-
getBody
Description copied from interface:HttpMessage
Return the body as the given type.- Specified by:
getBody
in interfaceHttpMessage<B>
- Type Parameters:
T
- The generic type- Parameters:
type
- The type of the body- Returns:
- An
Optional
of the type orOptional.empty()
if the body cannot be returned as the given type
-
onComplete
public void onComplete()Description copied from interface:Completable
* Successful terminal state. To be called when the operation is complete.- Specified by:
onComplete
in interfaceCompletable
- See Also:
-
toFullHttpResponse
Description copied from interface:NettyHttpResponseBuilder
Converts this object to a full http response.- Specified by:
toFullHttpResponse
in interfaceNettyHttpResponseBuilder
- Returns:
- a full http response
-
toHttpResponse
Description copied from interface:NettyHttpResponseBuilder
Converts this object to the most appropriate http response type.- Specified by:
toHttpResponse
in interfaceNettyHttpResponseBuilder
- Returns:
- The http response
-
isStream
public boolean isStream()- Specified by:
isStream
in interfaceNettyHttpResponseBuilder
- Returns:
- Is the response a stream.
-