Top Description Methods
reactor.netty.http.server

public Interface HttpServerRequest

extends NettyInbound, HttpServerInfos
Known Direct Implementers
reactor.netty.http.server.HttpServerOperations
Imports
java.net.InetSocketAddress, java.time.ZonedDateTime, java.util.Map, java.util.function.Consumer, .Function, io.netty.handler.codec.http.HttpContent, .HttpHeaders, io.netty.handler.codec.http.multipart.Attribute, .FileUpload, .HttpData, reactor.core.publisher.Flux, reactor.netty.Connection, .NettyInbound, reactor.util.annotation.Nullable

An Http Reactive Channel with several accessors related to HTTP flow: headers, params, URI, method, websocket...
Author
Stephane Maldini
Since
0.5

Method Summary

Modifier and TypeMethod and Description
public InetSocketAddress
hostAddress()

Redeclares reactor.netty.http.server.ConnectionInformation.hostAddress.

Returns the address of the host which received the request, possibly null in case of Unix Domain Sockets.
public boolean

Returns:

true if the request has Content-Type with value application/x-www-form-urlencoded, false - otherwise
isFormUrlencoded
()

Returns true if the request has Content-Type with value application/x-www-form-urlencoded.

public boolean

Returns:

true if the request has Content-Type with value multipart/form-data, false - otherwise
isMultipart
()

Returns true if the request has Content-Type with value multipart/form-data.

public String

Returns:

the parameter captured value
param
(CharSequence
parameter name e.g. "param" in URI /test/{param}
key
)

URI parameter captured via {} e.g. /test/{param}.

public Map<String, String>

Returns:

the parameters captured key/value map
params
()

Returns all URI parameters captured via {} e.g. /test/{param1}/{param2} as key/value map.

public HttpServerRequest

Returns:

this HttpServerRequest
paramsResolver
(Function<? super String, Map<String, String>>
a params resolver
paramsResolver
)

Specifies a params resolver.

public String

Returns:

the inbound protocol and version
protocol
()

Returns the inbound protocol and version.

public default Flux<HttpContent>

Returns:

a Flux of HttpContent containing received chunks
receiveContent
()

Returns a Flux of HttpContent containing received chunks.

public Flux<HttpData>

Returns:

a Flux of HttpData containing received Attribute/FileUpload
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.

public Flux<HttpData>

Returns:

a Flux of HttpData containing received Attribute/FileUpload
receiveForm
(Consumer<HttpServerFormDecoderProvider.Builder>
HttpServerFormDecoderProvider.Builder for HTTP form decoder configuration
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.

public InetSocketAddress
remoteAddress()

Redeclares reactor.netty.http.server.ConnectionInformation.remoteAddress.

Returns the address of the client that initiated the request, possibly null in case of Unix Domain Sockets.
public HttpHeaders

Returns:

inbound HttpHeaders
requestHeaders
()

Returns inbound HttpHeaders.

public ZonedDateTime

Returns:

the time when the request was received
timestamp
()

Returns the time when the request was received.

public HttpServerRequest
withConnection(Consumer<? super Connection>
connection callback
withConnection
)

Redeclares reactor.netty.NettyInbound.withConnection.

Calls the passed callback with a Connection to operate on the underlying Channel state.
Inherited from reactor.netty.http.server.HttpServerInfos:
allCookies
Inherited from reactor.netty.NettyInbound:
receivereceiveObject

Method Detail

hostAddressback to summary
public InetSocketAddress hostAddress()

Redeclares reactor.netty.http.server.ConnectionInformation.hostAddress.

Doc from reactor.netty.http.server.ConnectionInformation.hostAddress.

Returns the address of the host which received the request, possibly null in case of Unix Domain Sockets. The returned address is the merged information from all proxies.

Returns:InetSocketAddress

the address merged from all proxies of the host which received the request

Annotations
@Nullable
@Override
isFormUrlencodedback to summary
public boolean isFormUrlencoded()

Returns true if the request has Content-Type with value application/x-www-form-urlencoded.

Returns:boolean

true if the request has Content-Type with value application/x-www-form-urlencoded, false - otherwise

Since
1.0.11
isMultipartback to summary
public boolean isMultipart()

Returns true if the request has Content-Type with value multipart/form-data.

Returns:boolean

true if the request has Content-Type with value multipart/form-data, false - otherwise

Since
1.0.11
paramback to summary
public String param(CharSequence key)

URI parameter captured via {} e.g. /test/{param}.

Parameters
key:CharSequence

parameter name e.g. "param" in URI /test/{param}

Returns:String

the parameter captured value

Annotations
@Nullable
paramsback to summary
public Map<String, String> params()

Returns all URI parameters captured via {} e.g. /test/{param1}/{param2} as key/value map.

Returns:Map<String, String>

the parameters captured key/value map

Annotations
@Nullable
paramsResolverback to summary
public HttpServerRequest paramsResolver(Function<? super String, Map<String, String>> paramsResolver)

Specifies a params resolver.

Parameters
paramsResolver:Function<? super String, Map<String, String>>

a params resolver

Returns:HttpServerRequest

this HttpServerRequest

protocolback to summary
public String protocol()

Returns the inbound protocol and version.

Returns:String

the inbound protocol and version

Since
1.0.28
receiveContentback to summary
public default Flux<HttpContent> receiveContent()

Returns a Flux of HttpContent containing received chunks.

Returns:Flux<HttpContent>

a Flux of HttpContent containing received chunks

receiveFormback to summary
public Flux<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. 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.

Returns:Flux<HttpData>

a Flux of HttpData containing received Attribute/FileUpload

Since
1.0.11
receiveFormback to summary
public Flux<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. 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.

Parameters
formDecoderBuilder:Consumer<HttpServerFormDecoderProvider.Builder>

HttpServerFormDecoderProvider.Builder for HTTP form decoder configuration

Returns:Flux<HttpData>

a Flux of HttpData containing received Attribute/FileUpload

Since
1.0.11
remoteAddressback to summary
public InetSocketAddress remoteAddress()

Redeclares reactor.netty.http.server.ConnectionInformation.remoteAddress.

Doc from reactor.netty.http.server.ConnectionInformation.remoteAddress.

Returns the address of the client that initiated the request, possibly null in case of Unix Domain Sockets. The returned address is the merged information from all proxies.

Returns:InetSocketAddress

the address merged from all proxies of the client that initiated the request

Annotations
@Nullable
@Override
requestHeadersback to summary
public HttpHeaders requestHeaders()

Returns inbound HttpHeaders.

Returns:HttpHeaders

inbound HttpHeaders

timestampback to summary
public ZonedDateTime timestamp()

Returns the time when the request was received.

Returns:ZonedDateTime

the time when the request was received

Since
1.0.28
withConnectionback to summary
public HttpServerRequest withConnection(Consumer<? super Connection> withConnection)

Redeclares reactor.netty.NettyInbound.withConnection.

Doc from reactor.netty.NettyInbound.withConnection.

Calls the passed callback with a Connection to operate on the underlying Channel state. This allows for chaining inbound API.

Parameters
withConnection:Consumer<? super Connection>

connection callback

Returns:HttpServerRequest

the Connection

Annotations
@Override