public interface AggregatedHttpResponse
HttpData.| Modifier and Type | Method and Description |
|---|---|
HttpData |
content()
Returns the content of this message.
|
default String |
content(Charset charset)
Returns the content of this message as a string encoded in the specified
Charset. |
default String |
contentAscii()
Returns the content of this message as an ASCII string.
|
default MediaType |
contentType()
Returns the value of the
'content-type' header. |
default String |
contentUtf8()
Returns the content of this message as a UTF-8 string.
|
ResponseHeaders |
headers()
Returns the
ResponseHeaders. |
List<ResponseHeaders> |
informationals()
Returns the informational class (1xx) HTTP headers.
|
static AggregatedHttpResponse |
of(HttpStatus status)
Creates a new HTTP response.
|
static AggregatedHttpResponse |
of(HttpStatus status,
MediaType mediaType,
byte[] content)
Creates a new HTTP response of the specified
HttpStatus. |
static AggregatedHttpResponse |
of(HttpStatus status,
MediaType mediaType,
CharSequence content)
Creates a new HTTP response of the specified
HttpStatus. |
static AggregatedHttpResponse |
of(HttpStatus status,
MediaType mediaType,
HttpData content)
Creates a new HTTP response of the specified
HttpStatus. |
static AggregatedHttpResponse |
of(HttpStatus status,
MediaType mediaType,
HttpData content,
HttpHeaders trailers)
Creates a new HTTP response of the specified
HttpStatus. |
static AggregatedHttpResponse |
of(HttpStatus status,
MediaType mediaType,
String content)
Creates a new HTTP response of the specified
HttpStatus. |
static AggregatedHttpResponse |
of(HttpStatus status,
MediaType mediaType,
String format,
Object... args)
Creates a new HTTP response of the specified
HttpStatus. |
static AggregatedHttpResponse |
of(int statusCode)
Creates a new HTTP response.
|
static AggregatedHttpResponse |
of(Iterable<ResponseHeaders> informationals,
ResponseHeaders headers,
HttpData content,
HttpHeaders trailers)
Creates a new HTTP response.
|
static AggregatedHttpResponse |
of(ResponseHeaders headers)
Creates a new HTTP response with empty content.
|
static AggregatedHttpResponse |
of(ResponseHeaders headers,
HttpData content)
Creates a new HTTP response.
|
static AggregatedHttpResponse |
of(ResponseHeaders headers,
HttpData content,
HttpHeaders trailers)
Creates a new HTTP response.
|
HttpStatus |
status()
Returns the STATUS of this response.
|
default HttpResponse |
toHttpResponse()
Converts this response into a new complete
HttpResponse. |
HttpHeaders |
trailers()
Returns the HTTP trailers.
|
default HttpHeaders |
trailingHeaders()
Deprecated.
Use
trailers(). |
static AggregatedHttpResponse of(int statusCode)
statusCode - the HTTP status codestatic AggregatedHttpResponse of(HttpStatus status)
status - the HTTP statusstatic AggregatedHttpResponse of(HttpStatus status, MediaType mediaType, CharSequence content)
HttpStatus.mediaType - the MediaType of the response contentcontent - the content of the responsestatic AggregatedHttpResponse of(HttpStatus status, MediaType mediaType, String content)
HttpStatus.mediaType - the MediaType of the response contentcontent - the content of the responsestatic AggregatedHttpResponse of(HttpStatus status, MediaType mediaType, String format, Object... args)
HttpStatus. The content of the response is
formatted by String.format(Locale, String, Object...) with
English locale.mediaType - the MediaType of the response contentformat - the format string of the response contentargs - the arguments referenced by the format specifiers in the format stringstatic AggregatedHttpResponse of(HttpStatus status, MediaType mediaType, byte[] content)
HttpStatus. The content will be wrapped
using HttpData.wrap(byte[]), so any changes made to content will be reflected in the
response.mediaType - the MediaType of the response contentcontent - the content of the responsestatic AggregatedHttpResponse of(HttpStatus status, MediaType mediaType, HttpData content)
HttpStatus.mediaType - the MediaType of the response contentcontent - the content of the responsestatic AggregatedHttpResponse of(HttpStatus status, MediaType mediaType, HttpData content, HttpHeaders trailers)
HttpStatus.mediaType - the MediaType of the response contentcontent - the content of the responsetrailers - the HTTP trailersstatic AggregatedHttpResponse of(ResponseHeaders headers)
headers - the HTTP headersstatic AggregatedHttpResponse of(ResponseHeaders headers, HttpData content)
headers - the HTTP headerscontent - the content of the HTTP responsestatic AggregatedHttpResponse of(ResponseHeaders headers, HttpData content, HttpHeaders trailers)
headers - the HTTP headerscontent - the content of the HTTP responsetrailers - the HTTP trailersstatic AggregatedHttpResponse of(Iterable<ResponseHeaders> informationals, ResponseHeaders headers, HttpData content, HttpHeaders trailers)
informationals - the informational class (1xx) HTTP headersheaders - the HTTP headerscontent - the content of the HTTP responsetrailers - the HTTP trailersResponseHeaders headers()
ResponseHeaders.List<ResponseHeaders> informationals()
HttpStatus status()
default HttpResponse toHttpResponse()
HttpResponse.HttpResponse converted from this response.@Deprecated default HttpHeaders trailingHeaders()
trailers().HttpHeaders trailers()
HttpData content()
default String content(Charset charset)
Charset.default String contentUtf8()
default String contentAscii()
default MediaType contentType()
'content-type' header.null otherwise.Copyright © 2020 LeanCloud. All rights reserved.