Represents a client request in a server exchange.
- Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionOptional<? extends RequestBody>body()Returns the request body used to consume request payload.cookies()Returns the cookies sent in the request.Returns the request authority.Returns the socket address of the interface on which the request was received.Returns the HTTP method of the request.getPath()Returns the path to the resource targeted in the request.Returns the absolute path to the resource targeted in the request.Returns a path builder initialized with the path of the request.Returns the protocol of the request (eg.getQuery()Returns the query URI component.Returns the socket address of the client or last proxy that sent the request.Returns the name of the scheme used to send the request (eg. http, https...).headers()Returns the HTTP headers sent in the request.Returns the query parameters sent in the request.
-
Method Details
-
headers
RequestHeaders headers()Returns the HTTP headers sent in the request.
- Returns:
- the headers
-
queryParameters
QueryParameters queryParameters()Returns the query parameters sent in the request.
- Returns:
- the query parameters
-
cookies
RequestCookies cookies()Returns the cookies sent in the request.
- Returns:
- the cookies
-
getProtocol
String getProtocol()Returns the protocol of the request (eg. HTTP/1.1).
- Returns:
- the protocol
-
getMethod
Method getMethod()Returns the HTTP method of the request.
- Returns:
- the HTTP method
-
getScheme
String getScheme()Returns the name of the scheme used to send the request (eg. http, https...).
- Returns:
- the name of the scheme
-
getAuthority
String getAuthority()Returns the request authority.
- Returns:
- the authority
-
getPath
String getPath()Returns the path to the resource targeted in the request.
This path corresponds to the origin form as defined by RFC 7230 Section 5.3.1, as such it may contain a query URI component.
- Returns:
- the path to the targeted resource
-
getPathAbsolute
String getPathAbsolute()Returns the absolute path to the resource targeted in the request.
This path corresponds to the absolute path of the origin form as defined by RFC 7230 Section 5.3.1, as such it only contains the path URI component.
The resulting path is also normalized as defined by RFC 3986 Section 6.
- Returns:
- the normalized absolute path to the targeted resource
-
getPathBuilder
URIBuilder getPathBuilder()Returns a path builder initialized with the path of the request.
This method always returns a new
URIBuilderinstance withURIs.Option.NORMALIZEDoption. It is then safe to use it to build relative paths.- Returns:
- a new URI builder
-
getQuery
String getQuery()Returns the query URI component.
- Returns:
- a URI query component
-
getLocalAddress
SocketAddress getLocalAddress()Returns the socket address of the interface on which the request was received.
- Returns:
- a socket address
-
getRemoteAddress
SocketAddress getRemoteAddress()Returns the socket address of the client or last proxy that sent the request.
- Returns:
- a socket address
-
body
Optional<? extends RequestBody> body()Returns the request body used to consume request payload.
- Returns:
- an optional returning the request body or an empty optional if the request has no payload
-