B
- The Http message bodypublic interface HttpRequest<B> extends HttpMessage<B>
Common interface for HTTP request implementations.
Modifier and Type | Method and Description |
---|---|
static <T> MutableHttpRequest<T> |
create(HttpMethod httpMethod,
String uri)
Create a new
MutableHttpRequest for the given method and URI. |
static <T> MutableHttpRequest<T> |
DELETE(String uri)
Return a
MutableHttpRequest that executes an HttpMethod.DELETE request for the given URI. |
static <T> MutableHttpRequest<T> |
DELETE(String uri,
T body)
Return a
MutableHttpRequest that executes an HttpMethod.DELETE request for the given URI. |
static <T> MutableHttpRequest<T> |
DELETE(URI uri,
T body)
Return a
MutableHttpRequest that executes an HttpMethod.DELETE request for the given URI. |
static <T> MutableHttpRequest<T> |
GET(String uri)
Return a
MutableHttpRequest for a HttpMethod.GET request for the given URI. |
static <T> MutableHttpRequest<T> |
GET(URI uri)
Return a
MutableHttpRequest for a HttpMethod.GET request for the given URI. |
Cookies |
getCookies() |
default Optional<Locale> |
getLocale() |
HttpMethod |
getMethod() |
HttpParameters |
getParameters() |
default String |
getPath() |
default InetSocketAddress |
getRemoteAddress() |
default InetSocketAddress |
getServerAddress() |
default String |
getServerName() |
URI |
getUri() |
default Optional<Principal> |
getUserPrincipal()
The user principal stored within the request.
|
default <T extends Principal> |
getUserPrincipal(Class<T> principalType)
The user principal stored within the request.
|
static MutableHttpRequest<?> |
HEAD(String uri)
Return a
MutableHttpRequest for a HttpMethod.HEAD request for the given URI. |
static MutableHttpRequest<?> |
HEAD(URI uri)
Return a
MutableHttpRequest for a HttpMethod.HEAD request for the given URI. |
default boolean |
isSecure() |
static <T> MutableHttpRequest<T> |
OPTIONS(String uri)
Return a
MutableHttpRequest for a HttpMethod.OPTIONS request for the given URI. |
static <T> MutableHttpRequest<T> |
OPTIONS(URI uri)
Return a
MutableHttpRequest for a HttpMethod.OPTIONS request for the given URI. |
static <T> MutableHttpRequest<T> |
PATCH(String uri,
T body)
Return a
MutableHttpRequest that executes an HttpMethod.PATCH request for the given URI. |
static <T> MutableHttpRequest<T> |
PATCH(URI uri,
T body)
Return a
MutableHttpRequest that executes an HttpMethod.PATCH request for the given URI. |
static <T> MutableHttpRequest<T> |
POST(String uri,
T body)
Return a
MutableHttpRequest that executes an HttpMethod.POST request for the given URI. |
static <T> MutableHttpRequest<T> |
POST(URI uri,
T body)
Return a
MutableHttpRequest that executes an HttpMethod.POST request for the given URI. |
static <T> MutableHttpRequest<T> |
PUT(String uri,
T body)
Return a
MutableHttpRequest that executes an HttpMethod.PUT request for the given URI. |
static <T> MutableHttpRequest<T> |
PUT(URI uri,
T body)
Return a
MutableHttpRequest that executes an HttpMethod.PUT request for the given URI. |
default HttpRequest<B> |
setAttribute(CharSequence name,
Object value)
Sets an attribute on the message.
|
getAttributes, getBody, getBody, getBody, getCharacterEncoding, getContentLength, getContentType, getHeaders
removeAttribute
getAttribute, getAttribute
@Nonnull HttpParameters getParameters()
@Nonnull HttpMethod getMethod()
@Nonnull default Optional<Principal> getUserPrincipal()
@Nonnull default <T extends Principal> Optional<T> getUserPrincipal(Class<T> principalType)
T
- The principal typeprincipalType
- The principal type@Nonnull default InetSocketAddress getRemoteAddress()
@Nonnull default InetSocketAddress getServerAddress()
default boolean isSecure()
default HttpRequest<B> setAttribute(CharSequence name, Object value)
MutableAttributeHolder
setAttribute
in interface HttpMessage<B>
setAttribute
in interface MutableAttributeHolder
name
- The name of the attributevalue
- The value of the attributedefault Optional<Locale> getLocale()
getLocale
in interface HttpMessage<B>
static <T> MutableHttpRequest<T> GET(URI uri)
MutableHttpRequest
for a HttpMethod.GET
request for the given URI.T
- The Http request typeuri
- The URIMutableHttpRequest
instanceHttpRequestFactory
static <T> MutableHttpRequest<T> GET(String uri)
MutableHttpRequest
for a HttpMethod.GET
request for the given URI.T
- The Http request typeuri
- The URIMutableHttpRequest
instanceHttpRequestFactory
static <T> MutableHttpRequest<T> OPTIONS(URI uri)
MutableHttpRequest
for a HttpMethod.OPTIONS
request for the given URI.T
- The Http request typeuri
- The URIMutableHttpRequest
instanceHttpRequestFactory
static <T> MutableHttpRequest<T> OPTIONS(String uri)
MutableHttpRequest
for a HttpMethod.OPTIONS
request for the given URI.T
- The Http request typeuri
- The URIMutableHttpRequest
instanceHttpRequestFactory
static MutableHttpRequest<?> HEAD(URI uri)
MutableHttpRequest
for a HttpMethod.HEAD
request for the given URI.uri
- The URIMutableHttpRequest
instanceHttpRequestFactory
static MutableHttpRequest<?> HEAD(String uri)
MutableHttpRequest
for a HttpMethod.HEAD
request for the given URI.uri
- The URIMutableHttpRequest
instanceHttpRequestFactory
static <T> MutableHttpRequest<T> POST(URI uri, T body)
MutableHttpRequest
that executes an HttpMethod.POST
request for the given URI.T
- The body typeuri
- The URIbody
- The body of the request (content type defaults to MediaType.APPLICATION_JSON
MutableHttpRequest
instanceHttpRequestFactory
static <T> MutableHttpRequest<T> POST(String uri, T body)
MutableHttpRequest
that executes an HttpMethod.POST
request for the given URI.T
- The body typeuri
- The URIbody
- The body of the request (content type defaults to MediaType.APPLICATION_JSON
MutableHttpRequest
instanceHttpRequestFactory
static <T> MutableHttpRequest<T> PUT(URI uri, T body)
MutableHttpRequest
that executes an HttpMethod.PUT
request for the given URI.T
- The body typeuri
- The URIbody
- The body of the request (content type defaults to MediaType.APPLICATION_JSON
MutableHttpRequest
instanceHttpRequestFactory
static <T> MutableHttpRequest<T> PUT(String uri, T body)
MutableHttpRequest
that executes an HttpMethod.PUT
request for the given URI.T
- The body typeuri
- The URIbody
- The body of the request (content type defaults to MediaType.APPLICATION_JSON
MutableHttpRequest
instanceHttpRequestFactory
static <T> MutableHttpRequest<T> PATCH(URI uri, T body)
MutableHttpRequest
that executes an HttpMethod.PATCH
request for the given URI.T
- The body typeuri
- The URIbody
- The body of the request (content type defaults to MediaType.APPLICATION_JSON
MutableHttpRequest
instanceHttpRequestFactory
static <T> MutableHttpRequest<T> PATCH(String uri, T body)
MutableHttpRequest
that executes an HttpMethod.PATCH
request for the given URI.T
- The body typeuri
- The URIbody
- The body of the request (content type defaults to MediaType.APPLICATION_JSON
MutableHttpRequest
instanceHttpRequestFactory
static <T> MutableHttpRequest<T> DELETE(URI uri, T body)
MutableHttpRequest
that executes an HttpMethod.DELETE
request for the given URI.T
- The body typeuri
- The URIbody
- The body of the request (content type defaults to MediaType.APPLICATION_JSON
MutableHttpRequest
instanceHttpRequestFactory
static <T> MutableHttpRequest<T> DELETE(String uri, T body)
MutableHttpRequest
that executes an HttpMethod.DELETE
request for the given URI.T
- The body typeuri
- The URIbody
- The body of the request (content type defaults to MediaType.APPLICATION_JSON
MutableHttpRequest
instanceHttpRequestFactory
static <T> MutableHttpRequest<T> DELETE(String uri)
MutableHttpRequest
that executes an HttpMethod.DELETE
request for the given URI.T
- The Http request typeuri
- The URIMutableHttpRequest
instanceHttpRequestFactory
static <T> MutableHttpRequest<T> create(HttpMethod httpMethod, String uri)
MutableHttpRequest
for the given method and URI.T
- The Http request typehttpMethod
- The methoduri
- The URI