Package io.servicetalk.http.api
Interface HttpResponseMetaData
-
- All Superinterfaces:
HttpMetaData
- All Known Subinterfaces:
BlockingStreamingHttpResponse
,HttpResponse
,StreamingHttpResponse
- All Known Implementing Classes:
BlockingStreamingHttpServerResponse
public interface HttpResponseMetaData extends HttpMetaData
Meta data associated with an HTTP response. This includes pieces form the status line and other meta data fromHttpMetaData
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default HttpResponseMetaData
addCookie(HttpCookiePair cookie)
Adds a cookie.default HttpResponseMetaData
addCookie(java.lang.CharSequence name, java.lang.CharSequence value)
default HttpResponseMetaData
addHeader(java.lang.CharSequence name, java.lang.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(java.lang.CharSequence name, java.lang.CharSequence value)
default HttpResponseMetaData
setHeader(java.lang.CharSequence name, java.lang.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.HttpResponseStatus
status()
Returns the status of thisStreamingHttpResponse
.HttpResponseMetaData
status(HttpResponseStatus status)
Set the status of thisStreamingHttpResponse
.HttpResponseMetaData
version(HttpProtocolVersion version)
Set the protocol version of thisHttpMetaData
.
-
-
-
Method Detail
-
status
HttpResponseStatus status()
Returns the status of thisStreamingHttpResponse
.- Returns:
- The
HttpResponseStatus
of thisStreamingHttpResponse
-
status
HttpResponseMetaData status(HttpResponseStatus status)
Set the status of thisStreamingHttpResponse
.- Parameters:
status
- TheHttpResponseStatus
to set.- Returns:
this
.
-
version
HttpResponseMetaData version(HttpProtocolVersion 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
default HttpResponseMetaData addHeader(java.lang.CharSequence name, java.lang.CharSequence value)
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
default HttpResponseMetaData addHeaders(HttpHeaders headers)
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
default HttpResponseMetaData setHeader(java.lang.CharSequence name, java.lang.CharSequence value)
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
default HttpResponseMetaData setHeaders(HttpHeaders headers)
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
default HttpResponseMetaData addCookie(HttpCookiePair cookie)
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
default HttpResponseMetaData addCookie(java.lang.CharSequence name, java.lang.CharSequence value)
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
default HttpResponseMetaData addSetCookie(HttpSetCookie cookie)
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
default HttpResponseMetaData addSetCookie(java.lang.CharSequence name, java.lang.CharSequence value)
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
.
-
-