Package io.servicetalk.http.api
Interface HttpResponseMetaData
- All Superinterfaces:
ContextMapHolder
,HttpMetaData
- All Known Subinterfaces:
BlockingStreamingHttpResponse
,BlockingStreamingHttpServerResponse
,HttpResponse
,StreamingHttpResponse
Meta data associated with an HTTP response.
This includes pieces form the status line and
other meta data from
HttpMetaData
.-
Method Summary
Modifier and TypeMethodDescriptiondefault HttpResponseMetaData
addCookie
(HttpCookiePair cookie) Adds a cookie.default HttpResponseMetaData
addCookie
(CharSequence name, CharSequence value) default HttpResponseMetaData
addHeader
(CharSequence name, CharSequence value) Adds a new header with the specifiedname
andvalue
.default HttpResponseMetaData
addHeaders
(HttpHeaders headers) Adds all header names and values ofheaders
object.default HttpResponseMetaData
addSetCookie
(HttpSetCookie cookie) Adds a set-cookie.default HttpResponseMetaData
addSetCookie
(CharSequence name, CharSequence value) context
(ContextMap context) Sets a context for thisHttpMetaData
.default HttpResponseMetaData
setHeader
(CharSequence name, CharSequence value) Sets a header with the specifiedname
andvalue
.default HttpResponseMetaData
setHeaders
(HttpHeaders headers) Clears the current header entries and copies all header entries of the specifiedheaders
object.status()
Returns the status of thisStreamingHttpResponse
.status
(HttpResponseStatus status) Set the status of thisStreamingHttpResponse
.version
(HttpProtocolVersion version) Set the protocol version of thisHttpMetaData
.
-
Method Details
-
status
HttpResponseStatus status()Returns the status of thisStreamingHttpResponse
.- Returns:
- The
HttpResponseStatus
of thisStreamingHttpResponse
-
status
Set the status of thisStreamingHttpResponse
.- Parameters:
status
- TheHttpResponseStatus
to set.- Returns:
this
.
-
version
Description copied from interface:HttpMetaData
Set the protocol version of thisHttpMetaData
.- Specified by:
version
in interfaceHttpMetaData
- Parameters:
version
- the protocol version to set.- Returns:
this
.
-
addHeader
Description copied from interface:HttpMetaData
Adds a new header with the specifiedname
andvalue
.- Specified by:
addHeader
in interfaceHttpMetaData
- Parameters:
name
- the name of the header.value
- the value of the header.- Returns:
this
.
-
addHeaders
Description copied from interface:HttpMetaData
Adds all header names and values ofheaders
object.- Specified by:
addHeaders
in interfaceHttpMetaData
- Parameters:
headers
- the headers to add.- Returns:
this
.
-
setHeader
Description copied from interface:HttpMetaData
Sets a header with the specifiedname
andvalue
. Any existing headers with the same name are overwritten.- Specified by:
setHeader
in interfaceHttpMetaData
- Parameters:
name
- the name of the header.value
- the value of the header.- Returns:
this
.
-
setHeaders
Description copied from interface:HttpMetaData
Clears the current header entries and copies all header entries of the specifiedheaders
object.- Specified by:
setHeaders
in interfaceHttpMetaData
- Parameters:
headers
- the headers object which contains new values.- Returns:
this
.
-
addCookie
Description copied from interface:HttpMetaData
Adds a cookie.This may result in multiple
HttpCookiePair
s with same name.- Specified by:
addCookie
in interfaceHttpMetaData
- Parameters:
cookie
- the cookie to add.- Returns:
this
.
-
addCookie
Description copied from interface:HttpMetaData
Adds a cookie with the specifiedname
andvalue
.This may result in multiple
HttpSetCookie
s with same name. Added cookie will not be wrapped, not secure, and not HTTP-only, with no path, domain, expire date and maximum age.- Specified by:
addCookie
in interfaceHttpMetaData
- Parameters:
name
- the name of the cookie.value
- the value of the cookie.- Returns:
this
.
-
addSetCookie
Description copied from interface:HttpMetaData
Adds a set-cookie.This may result in multiple
HttpSetCookie
s with same name.- Specified by:
addSetCookie
in interfaceHttpMetaData
- Parameters:
cookie
- the cookie to add.- Returns:
this
.
-
addSetCookie
Description copied from interface:HttpMetaData
Adds a set-cookie with the specifiedname
andvalue
.This may result in multiple
HttpSetCookie
s with same name. Added cookie will not be wrapped, not secure, and not HTTP-only, with no path, domain, expire date and maximum age.- Specified by:
addSetCookie
in interfaceHttpMetaData
- Parameters:
name
- the name of the cookie.value
- the value of the cookie.- Returns:
this
.
-
context
Description copied from interface:HttpMetaData
Sets a context for thisHttpMetaData
.Context can be used to associate a state with a request or response message without serializing its state on the wire.
- Specified by:
context
in interfaceContextMapHolder
- Specified by:
context
in interfaceHttpMetaData
- Parameters:
context
- the new context for thisHttpMetaData
.- Returns:
this
.
-