- All Superinterfaces:
BaseRequest
,Request
A request with supports for body encoding based on the request content type.
- Since:
- 1.12
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptionSets the request authority.body()
Returns the request body when the request method allows it.getUri()
Returns the Web request URI.headers
(Consumer<OutboundRequestHeaders> headersConfigurer) Configures the HTTP headers to send in the request.Sets the request method.Sets the request path.Methods inherited from interface io.inverno.mod.http.base.BaseRequest
getAuthority, getLocalAddress, getLocalCertificates, getMethod, getPath, getPathAbsolute, getPathBuilder, getQuery, getRemoteAddress, getRemoteCertificates, getScheme, headers, queryParameters
Methods inherited from interface io.inverno.mod.http.client.Request
isHeadersWritten
-
Method Details
-
getUri
URI getUri()Returns the Web request URI.
- Returns:
- the request URI
-
headers
Description copied from interface:Request
Configures the HTTP headers to send in the request.
- Specified by:
headers
in interfaceRequest
- Parameters:
headersConfigurer
- an outbound request headers configurer- Returns:
- the request
- Throws:
IllegalStateException
- if the request has already been sent to the endpoint
-
path
Description copied from interface:Request
Sets the request path.
This actually overrides the request target path provided when the request was created using
Endpoint.exchange(io.inverno.mod.http.base.Method, java.lang.String)
orEndpoint.exchange(io.inverno.mod.http.base.Method, java.lang.String, io.inverno.mod.http.base.ExchangeContext)
.- Specified by:
path
in interfaceRequest
- Parameters:
path
- the request target path- Returns:
- the request
- Throws:
IllegalStateException
- if the request has already been sent to the endpoint
-
authority
Description copied from interface:Request
Sets the request authority.
- Specified by:
authority
in interfaceRequest
- Parameters:
authority
- the request authority- Returns:
- the request
- Throws:
IllegalStateException
- if the request has already been sent to the endpoint
-
method
Description copied from interface:Request
Sets the request method.
This actually overrides the method provided when the enclosing exchange was created by the
Endpoint
. It defaults toMethod.GET
if none is specified.- Specified by:
method
in interfaceRequest
- Parameters:
method
- the request method- Returns:
- the request
- Throws:
IllegalStateException
- if the request has already been sent to the endpoint
-
body
Description copied from interface:Request
Returns the request body when the request method allows it.
- Specified by:
body
in interfaceRequest
- Returns:
- the request body when the method allows it (i.e.
POST
PUT
...) - Throws:
IllegalStateException
- if the method does not allow a body in the request (i.e.GET
...) or if the request has already been sent to the endpoint
-