public interface AggregatedHttpRequest
HttpData.| Modifier and Type | Method and Description |
|---|---|
String |
authority()
Returns the AUTHORITY of this request, in the form of
"hostname:port". |
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.
|
RequestHeaders |
headers()
Returns the
RequestHeaders. |
HttpMethod |
method()
Returns the METHOD of this request.
|
static AggregatedHttpRequest |
of(HttpMethod method,
String path)
Creates a new HTTP request with empty content.
|
static AggregatedHttpRequest |
of(HttpMethod method,
String path,
MediaType mediaType,
byte[] content)
Creates a new HTTP request.
|
static AggregatedHttpRequest |
of(HttpMethod method,
String path,
MediaType mediaType,
CharSequence content)
Creates a new HTTP request.
|
static AggregatedHttpRequest |
of(HttpMethod method,
String path,
MediaType mediaType,
HttpData content)
Creates a new HTTP request.
|
static AggregatedHttpRequest |
of(HttpMethod method,
String path,
MediaType mediaType,
HttpData content,
HttpHeaders trailers)
Creates a new HTTP request.
|
static AggregatedHttpRequest |
of(HttpMethod method,
String path,
MediaType mediaType,
String content)
Creates a new HTTP request.
|
static AggregatedHttpRequest |
of(HttpMethod method,
String path,
MediaType mediaType,
String format,
Object... args)
Creates a new HTTP request.
|
static AggregatedHttpRequest |
of(RequestHeaders headers)
Creates a new HTTP request with empty content.
|
static AggregatedHttpRequest |
of(RequestHeaders headers,
HttpData content)
Creates a new HTTP request.
|
static AggregatedHttpRequest |
of(RequestHeaders headers,
HttpData content,
HttpHeaders trailers)
Creates a new HTTP request.
|
String |
path()
Returns the PATH of this request.
|
String |
scheme()
Returns the SCHEME of this request.
|
default HttpRequest |
toHttpRequest()
Converts this request into a new complete
HttpRequest. |
HttpHeaders |
trailers()
Returns the HTTP trailers.
|
default HttpHeaders |
trailingHeaders()
Deprecated.
Use
trailers(). |
static AggregatedHttpRequest of(HttpMethod method, String path)
method - the HTTP method of the requestpath - the path of the requeststatic AggregatedHttpRequest of(HttpMethod method, String path, MediaType mediaType, CharSequence content)
method - the HTTP method of the requestpath - the path of the requestmediaType - the MediaType of the request contentcontent - the content of the requeststatic AggregatedHttpRequest of(HttpMethod method, String path, MediaType mediaType, String content)
method - the HTTP method of the requestpath - the path of the requestmediaType - the MediaType of the request contentcontent - the content of the requeststatic AggregatedHttpRequest of(HttpMethod method, String path, MediaType mediaType, String format, Object... args)
String.format(Locale, String, Object...) with English locale.method - the HTTP method of the requestpath - the path of the requestmediaType - the MediaType of the request contentformat - the format string of the request contentargs - the arguments referenced by the format specifiers in the format stringstatic AggregatedHttpRequest of(HttpMethod method, String path, MediaType mediaType, byte[] content)
content will be wrapped using HttpData.wrap(byte[]), so
any changes made to content will be reflected in the request.method - the HTTP method of the requestpath - the path of the requestmediaType - the MediaType of the request contentcontent - the content of the requeststatic AggregatedHttpRequest of(HttpMethod method, String path, MediaType mediaType, HttpData content)
method - the HTTP method of the requestpath - the path of the requestmediaType - the MediaType of the request contentcontent - the content of the requeststatic AggregatedHttpRequest of(HttpMethod method, String path, MediaType mediaType, HttpData content, HttpHeaders trailers)
method - the HTTP method of the requestpath - the path of the requestmediaType - the MediaType of the request contentcontent - the content of the requesttrailers - the HTTP trailersstatic AggregatedHttpRequest of(RequestHeaders headers)
headers - the HTTP request headersstatic AggregatedHttpRequest of(RequestHeaders headers, HttpData content)
headers - the HTTP request headerscontent - the content of the requeststatic AggregatedHttpRequest of(RequestHeaders headers, HttpData content, HttpHeaders trailers)
headers - the HTTP request headerscontent - the content of the requesttrailers - the HTTP trailersRequestHeaders headers()
RequestHeaders.HttpMethod method()
String scheme()
null if there's no such headerString authority()
"hostname:port".null if there's no such headerdefault HttpRequest toHttpRequest()
HttpRequest.HttpRequest converted from this request.@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.