public interface HttpResponse extends HttpResponseMetaData
Object.| Modifier and Type | Method and Description |
|---|---|
default HttpResponse |
addCookie(CharSequence name,
CharSequence value)
|
default HttpResponse |
addCookie(HttpCookiePair cookie)
Adds a cookie.
|
default HttpResponse |
addHeader(CharSequence name,
CharSequence value)
Adds a new header with the specified
name and value. |
default HttpResponse |
addHeaders(HttpHeaders headers)
Adds all header names and values of
headers object. |
default HttpResponse |
addSetCookie(CharSequence name,
CharSequence value)
|
default HttpResponse |
addSetCookie(HttpSetCookie cookie)
Adds a set-cookie.
|
default HttpResponse |
addTrailer(CharSequence name,
CharSequence value)
Adds a new trailer with the specified
name and value. |
default HttpResponse |
addTrailers(HttpHeaders trailers)
Adds all trailer names and values of
trailer object. |
Buffer |
payloadBody()
Gets the underlying payload as a
Buffer. |
HttpResponse |
payloadBody(Buffer payloadBody)
Returns an
HttpResponse with its underlying payload set to payloadBody. |
default <T> T |
payloadBody(HttpDeserializer<T> deserializer)
Gets and deserializes the payload body.
|
<T> HttpResponse |
payloadBody(T pojo,
HttpSerializer<T> serializer)
Returns an
HttpResponse with its underlying payload set to the results of serialization of pojo. |
default HttpResponse |
setHeader(CharSequence name,
CharSequence value)
Sets a header with the specified
name and value. |
default HttpResponse |
setHeaders(HttpHeaders headers)
Clears the current header entries and copies all header entries of the specified
headers object. |
default HttpResponse |
setTrailer(CharSequence name,
CharSequence value)
Sets a trailer with the specified
name and value. |
default HttpResponse |
setTrailers(HttpHeaders trailers)
Clears the current trailer entries and copies all trailer entries of the specified
trailers object. |
HttpResponse |
status(HttpResponseStatus status)
Set the status of this
StreamingHttpResponse. |
BlockingStreamingHttpResponse |
toBlockingStreamingResponse()
Translates this
HttpResponse to a BlockingStreamingHttpResponse. |
StreamingHttpResponse |
toStreamingResponse()
Translates this
HttpResponse to a StreamingHttpResponse. |
HttpHeaders |
trailers()
Gets the trailers.
|
HttpResponse |
version(HttpProtocolVersion version)
Set the protocol version of this
HttpMetaData. |
statusBuffer payloadBody()
Buffer.Buffer representation of the underlying payload.default <T> T payloadBody(HttpDeserializer<T> deserializer)
T - The resulting type of the deserialization operation.deserializer - The function that deserializes the underlying Object.HttpResponse payloadBody(Buffer payloadBody)
HttpResponse with its underlying payload set to payloadBody.payloadBody - the underlying payload.this<T> HttpResponse payloadBody(T pojo, HttpSerializer<T> serializer)
HttpResponse with its underlying payload set to the results of serialization of pojo.T - The type of object to serialize.pojo - The object to serialize.serializer - The HttpSerializer which converts pojo into bytes.thisStreamingHttpResponse toStreamingResponse()
HttpResponse to a StreamingHttpResponse.StreamingHttpResponse representation of this HttpResponse.BlockingStreamingHttpResponse toBlockingStreamingResponse()
HttpResponse to a BlockingStreamingHttpResponse.BlockingStreamingHttpResponse representation of this HttpResponse.HttpResponse version(HttpProtocolVersion version)
HttpMetaDataHttpMetaData.version in interface HttpMetaDataversion in interface HttpResponseMetaDataversion - the protocol version to set.this.HttpResponse status(HttpResponseStatus status)
HttpResponseMetaDataStreamingHttpResponse.status in interface HttpResponseMetaDatastatus - The HttpResponseStatus to set.this.default HttpResponse addHeader(CharSequence name, CharSequence value)
HttpMetaDataname and value.addHeader in interface HttpMetaDataaddHeader in interface HttpResponseMetaDataname - the name of the header.value - the value of the header.this.default HttpResponse addHeaders(HttpHeaders headers)
HttpMetaDataheaders object.addHeaders in interface HttpMetaDataaddHeaders in interface HttpResponseMetaDataheaders - the headers to add.this.default HttpResponse setHeader(CharSequence name, CharSequence value)
HttpMetaDataname and value. Any existing headers with the same name are
overwritten.setHeader in interface HttpMetaDatasetHeader in interface HttpResponseMetaDataname - the name of the header.value - the value of the header.this.default HttpResponse setHeaders(HttpHeaders headers)
HttpMetaDataheaders object.setHeaders in interface HttpMetaDatasetHeaders in interface HttpResponseMetaDataheaders - the headers object which contains new values.this.default HttpResponse addCookie(HttpCookiePair cookie)
HttpMetaData
This may result in multiple HttpCookiePairs with same name.
addCookie in interface HttpMetaDataaddCookie in interface HttpResponseMetaDatacookie - the cookie to add.this.default HttpResponse addCookie(CharSequence name, CharSequence value)
HttpMetaDataname and
value.
This may result in multiple HttpSetCookies with same name. Added cookie will not be wrapped, not secure,
and not HTTP-only, with no path, domain, expire date and maximum age.
addCookie in interface HttpMetaDataaddCookie in interface HttpResponseMetaDataname - the name of the cookie.value - the value of the cookie.this.default HttpResponse addSetCookie(HttpSetCookie cookie)
HttpMetaData
This may result in multiple HttpSetCookies with same name.
addSetCookie in interface HttpMetaDataaddSetCookie in interface HttpResponseMetaDatacookie - the cookie to add.this.default HttpResponse addSetCookie(CharSequence name, CharSequence value)
HttpMetaDataname
and value.
This may result in multiple HttpSetCookies with same name. Added cookie will not be wrapped, not secure,
and not HTTP-only, with no path, domain, expire date and maximum age.
addSetCookie in interface HttpMetaDataaddSetCookie in interface HttpResponseMetaDataname - the name of the cookie.value - the value of the cookie.this.default HttpResponse addTrailer(CharSequence name, CharSequence value)
name and value.name - the name of the trailer.value - the value of the trailer.this.default HttpResponse addTrailers(HttpHeaders trailers)
trailer object.trailers - the trailers to add.this.default HttpResponse setTrailer(CharSequence name, CharSequence value)
name and value. Any existing trailers with the same name are
overwritten.name - the name of the trailer.value - the value of the trailer.this.default HttpResponse setTrailers(HttpHeaders trailers)
trailers object.trailers - the trailers object which contains new values.this.HttpHeaders trailers()