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 HttpResponseMetaDataaddCookie(HttpCookiePair cookie) Adds a cookie.default HttpResponseMetaDataaddCookie(CharSequence name, CharSequence value) default HttpResponseMetaDataaddHeader(CharSequence name, CharSequence value) Adds a new header with the specifiednameandvalue.default HttpResponseMetaDataaddHeaders(HttpHeaders headers) Adds all header names and values ofheadersobject.default HttpResponseMetaDataaddSetCookie(HttpSetCookie cookie) Adds a set-cookie.default HttpResponseMetaDataaddSetCookie(CharSequence name, CharSequence value) context(ContextMap context) Sets a context for thisHttpMetaData.default HttpResponseMetaDatasetHeader(CharSequence name, CharSequence value) Sets a header with the specifiednameandvalue.default HttpResponseMetaDatasetHeaders(HttpHeaders headers) Clears the current header entries and copies all header entries of the specifiedheadersobject.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
HttpResponseStatusof thisStreamingHttpResponse
-
status
Set the status of thisStreamingHttpResponse.- Parameters:
status- TheHttpResponseStatusto set.- Returns:
this.
-
version
Description copied from interface:HttpMetaDataSet the protocol version of thisHttpMetaData.- Specified by:
versionin interfaceHttpMetaData- Parameters:
version- the protocol version to set.- Returns:
this.
-
addHeader
Description copied from interface:HttpMetaDataAdds a new header with the specifiednameandvalue.- Specified by:
addHeaderin interfaceHttpMetaData- Parameters:
name- the name of the header.value- the value of the header.- Returns:
this.
-
addHeaders
Description copied from interface:HttpMetaDataAdds all header names and values ofheadersobject.- Specified by:
addHeadersin interfaceHttpMetaData- Parameters:
headers- the headers to add.- Returns:
this.
-
setHeader
Description copied from interface:HttpMetaDataSets a header with the specifiednameandvalue. Any existing headers with the same name are overwritten.- Specified by:
setHeaderin interfaceHttpMetaData- Parameters:
name- the name of the header.value- the value of the header.- Returns:
this.
-
setHeaders
Description copied from interface:HttpMetaDataClears the current header entries and copies all header entries of the specifiedheadersobject.- Specified by:
setHeadersin interfaceHttpMetaData- Parameters:
headers- the headers object which contains new values.- Returns:
this.
-
addCookie
Description copied from interface:HttpMetaDataAdds a cookie.This may result in multiple
HttpCookiePairs with same name.- Specified by:
addCookiein interfaceHttpMetaData- Parameters:
cookie- the cookie to add.- Returns:
this.
-
addCookie
Description copied from interface:HttpMetaDataAdds a cookie with the specifiednameandvalue.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.- Specified by:
addCookiein interfaceHttpMetaData- Parameters:
name- the name of the cookie.value- the value of the cookie.- Returns:
this.
-
addSetCookie
Description copied from interface:HttpMetaDataAdds a set-cookie.This may result in multiple
HttpSetCookies with same name.- Specified by:
addSetCookiein interfaceHttpMetaData- Parameters:
cookie- the cookie to add.- Returns:
this.
-
addSetCookie
Description copied from interface:HttpMetaDataAdds a set-cookie with the specifiednameandvalue.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.- Specified by:
addSetCookiein interfaceHttpMetaData- Parameters:
name- the name of the cookie.value- the value of the cookie.- Returns:
this.
-
context
Description copied from interface:HttpMetaDataSets 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:
contextin interfaceContextMapHolder- Specified by:
contextin interfaceHttpMetaData- Parameters:
context- the new context for thisHttpMetaData.- Returns:
this.
-