public interface HttpServerRequest extends NettyInbound, HttpServerInfos
Modifier and Type | Method and Description |
---|---|
InetSocketAddress |
hostAddress()
Returns the address of the host which received the request, possibly
null in case of Unix Domain Sockets. |
boolean |
isFormUrlencoded()
Returns true if the request has
Content-Type with value application/x-www-form-urlencoded . |
boolean |
isMultipart()
Returns true if the request has
Content-Type with value multipart/form-data . |
String |
param(CharSequence key)
URI parameter captured via
{} e.g. |
Map<String,String> |
params()
Returns all URI parameters captured via
{} e.g. |
HttpServerRequest |
paramsResolver(Function<? super String,Map<String,String>> paramsResolver)
Specifies a params resolver.
|
default Flux<io.netty.handler.codec.http.HttpContent> |
receiveContent()
Returns a
Flux of HttpContent containing received chunks |
Flux<io.netty.handler.codec.http.multipart.HttpData> |
receiveForm()
When the request is
POST and have Content-Type with value
application/x-www-form-urlencoded or multipart/form-data ,
returns a Flux of HttpData containing received Attribute /FileUpload . |
Flux<io.netty.handler.codec.http.multipart.HttpData> |
receiveForm(Consumer<HttpServerFormDecoderProvider.Builder> formDecoderBuilder)
When the request is
POST and have Content-Type with value
application/x-www-form-urlencoded or multipart/form-data ,
returns a Flux of HttpData containing received Attribute /FileUpload . |
InetSocketAddress |
remoteAddress()
Returns the address of the client that initiated the request, possibly
null in case of Unix Domain Sockets. |
io.netty.handler.codec.http.HttpHeaders |
requestHeaders()
Returns inbound
HttpHeaders |
HttpServerRequest |
withConnection(Consumer<? super Connection> withConnection)
Calls the passed callback with a
Connection to operate on the
underlying Channel state. |
receive, receiveObject
allCookies
cookies, fullPath, isKeepAlive, isWebsocket, method, path, requestId, uri, version
connectionHostAddress, connectionRemoteAddress, connectionScheme, scheme
HttpServerRequest withConnection(Consumer<? super Connection> withConnection)
NettyInbound
Connection
to operate on the
underlying Channel
state. This allows for chaining inbound API.withConnection
in interface NettyInbound
withConnection
- connection callbackConnection
@Nullable String param(CharSequence key)
{}
e.g. /test/{param}
.key
- parameter name e.g. "param"
in URI /test/{param}
@Nullable Map<String,String> params()
{}
e.g. /test/{param1}/{param2}
as key/value map.HttpServerRequest paramsResolver(Function<? super String,Map<String,String>> paramsResolver)
paramsResolver
- a params resolverHttpServerRequest
default Flux<io.netty.handler.codec.http.HttpContent> receiveContent()
Flux
of HttpContent
containing received chunksFlux
of HttpContent
containing received chunksboolean isFormUrlencoded()
Content-Type
with value application/x-www-form-urlencoded
.Content-Type
with value application/x-www-form-urlencoded
,
false - otherwiseboolean isMultipart()
Content-Type
with value multipart/form-data
.Content-Type
with value multipart/form-data
,
false - otherwiseFlux<io.netty.handler.codec.http.multipart.HttpData> receiveForm()
POST
and have Content-Type
with value
application/x-www-form-urlencoded
or multipart/form-data
,
returns a Flux
of HttpData
containing received Attribute
/FileUpload
.
When the request is not POST
or does not have Content-Type
with value application/x-www-form-urlencoded
or multipart/form-data
,
a Flux.error(Throwable)
will be returned.
Uses HTTP form decoder configuration specified on server level or the default one if nothing is configured.
HttpData.retain()
disables auto memory release on each HttpData
published,
retaining in order to prevent premature recycling when HttpData
is accumulated downstream.
Flux
of HttpData
containing received Attribute
/FileUpload
Flux<io.netty.handler.codec.http.multipart.HttpData> receiveForm(Consumer<HttpServerFormDecoderProvider.Builder> formDecoderBuilder)
POST
and have Content-Type
with value
application/x-www-form-urlencoded
or multipart/form-data
,
returns a Flux
of HttpData
containing received Attribute
/FileUpload
.
When the request is not POST
or does not have Content-Type
with value application/x-www-form-urlencoded
or multipart/form-data
,
a Flux.error(Throwable)
will be returned.
HttpData.retain()
disables auto memory release on each HttpData
published,
retaining in order to prevent premature recycling when HttpData
is accumulated downstream.
formDecoderBuilder
- HttpServerFormDecoderProvider.Builder
for HTTP form decoder configurationFlux
of HttpData
containing received Attribute
/FileUpload
@Nullable InetSocketAddress hostAddress()
ConnectionInformation
null
in case of Unix Domain Sockets.
The returned address is the merged informations from all proxies.hostAddress
in interface ConnectionInformation
@Nullable InetSocketAddress remoteAddress()
ConnectionInformation
null
in case of Unix Domain Sockets.
The returned address is the merged informations from all proxies.remoteAddress
in interface ConnectionInformation
io.netty.handler.codec.http.HttpHeaders requestHeaders()
HttpHeaders
HttpHeaders