public interface AggregatedHttpMessage
HttpData
. It can be an
HTTP request or an HTTP response depending on what header values it contains. For example, having a
HttpHeaderNames.STATUS
header could mean it is an HTTP response.Modifier and Type | Method and Description |
---|---|
default java.lang.String |
authority()
Returns the
AUTHORITY of this message, in the form of
"hostname:port" . |
HttpData |
content()
Returns the content of this message.
|
HttpHeaders |
headers()
Returns the HTTP headers.
|
java.util.List<HttpHeaders> |
informationals()
Returns the informational class (1xx) HTTP headers.
|
default HttpMethod |
method()
Returns the
METHOD of this message. |
static AggregatedHttpMessage |
of(HttpHeaders headers)
Creates a new HTTP message with empty content.
|
static AggregatedHttpMessage |
of(HttpHeaders headers,
HttpData content)
Creates a new HTTP message.
|
static AggregatedHttpMessage |
of(HttpHeaders headers,
HttpData content,
HttpHeaders trailingHeaders)
Creates a new HTTP message.
|
static AggregatedHttpMessage |
of(HttpMethod method,
java.lang.String path)
Creates a new HTTP request with empty content.
|
static AggregatedHttpMessage |
of(HttpMethod method,
java.lang.String path,
HttpData content)
Creates a new HTTP request.
|
static AggregatedHttpMessage |
of(HttpStatus status)
Creates a new HTTP response with empty content.
|
static AggregatedHttpMessage |
of(HttpStatus status,
HttpData content)
Creates a new HTTP response.
|
static AggregatedHttpMessage |
of(int statusCode)
Creates a new HTTP response with empty content.
|
static AggregatedHttpMessage |
of(java.lang.Iterable<HttpHeaders> informationals,
HttpHeaders headers,
HttpData content,
HttpHeaders trailingHeaders)
Creates a new HTTP message.
|
default java.lang.String |
path()
Returns the
PATH of this message. |
default java.lang.String |
scheme()
Returns the
SCHEME of this message. |
default HttpStatus |
status()
Returns the
STATUS of this message. |
HttpHeaders |
trailingHeaders()
Returns the trailing HTTP headers.
|
static AggregatedHttpMessage of(HttpMethod method, java.lang.String path)
method
- the HTTP method of the requestpath
- the path of the requeststatic AggregatedHttpMessage of(HttpMethod method, java.lang.String path, HttpData content)
method
- the HTTP method of the requestpath
- the path of the requestcontent
- the content of the requeststatic AggregatedHttpMessage of(int statusCode)
statusCode
- the HTTP status codestatic AggregatedHttpMessage of(HttpStatus status)
status
- the HTTP statusstatic AggregatedHttpMessage of(HttpStatus status, HttpData content)
status
- the HTTP statuscontent
- the content of the HTTP responsestatic AggregatedHttpMessage of(HttpHeaders headers)
headers
- the HTTP headersstatic AggregatedHttpMessage of(HttpHeaders headers, HttpData content)
headers
- the HTTP headerscontent
- the content of the HTTP messagestatic AggregatedHttpMessage of(HttpHeaders headers, HttpData content, HttpHeaders trailingHeaders)
headers
- the HTTP headerscontent
- the content of the HTTP messagetrailingHeaders
- the trailing HTTP headersstatic AggregatedHttpMessage of(java.lang.Iterable<HttpHeaders> informationals, HttpHeaders headers, HttpData content, HttpHeaders trailingHeaders)
informationals
- the informational class (1xx) HTTP headersheaders
- the HTTP headerscontent
- the content of the HTTP messagetrailingHeaders
- the trailing HTTP headersjava.util.List<HttpHeaders> informationals()
HttpHeaders headers()
HttpHeaders trailingHeaders()
HttpData content()
default java.lang.String scheme()
SCHEME
of this message.null
if there's no such headerdefault HttpMethod method()
METHOD
of this message.null
if there's no such headerdefault java.lang.String path()
PATH
of this message.null
if there's no such headerdefault java.lang.String authority()
AUTHORITY
of this message, in the form of
"hostname:port"
.null
if there's no such headerdefault HttpStatus status()
STATUS
of this message.null
if there's no such header