Top Description Methods
reactor.netty5.http.server

public Interface HttpServerRequest

extends NettyInbound, HttpServerInfos
Known Direct Implementers
reactor.netty5.http.server.HttpServerOperations
Imports
java.net.InetSocketAddress, java.util.Map, java.util.function.Consumer, .Function, io.netty.contrib.handler.codec.http.multipart.Attribute, .FileUpload, .HttpData, io.netty5.handler.codec.http.HttpContent, io.netty5.handler.codec.http.headers.HttpHeaders, reactor.core.publisher.Flux, reactor.netty5.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

Returns:

the host's address
hostAddress
()

Returns the address of the host peer or 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 default Flux<HttpContent<R extends HttpContent<R>>>

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

Returns:

the peer's address
remoteAddress
()

Returns the address of the remote peer or null in case of Unix Domain Sockets.

public HttpHeaders

Returns:

inbound HttpHeaders
requestHeaders
()

Returns inbound HttpHeaders

public String

Returns:

the protocol scheme
scheme
()

Returns the current protocol scheme

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

Redeclares reactor.netty5.NettyInbound.withConnection.

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

Method Detail

hostAddressback to summary
public InetSocketAddress hostAddress()

Returns the address of the host peer or null in case of Unix Domain Sockets.

Returns:InetSocketAddress

the host's address

Annotations
@Nullable
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

receiveContentback to summary
public default Flux<HttpContent<R extends HttpContent<R>>> receiveContent()

Returns a Flux of HttpContent containing received chunks

Returns:Flux<HttpContent<R extends HttpContent<R>>>

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.

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.

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()

Returns the address of the remote peer or null in case of Unix Domain Sockets.

Returns:InetSocketAddress

the peer's address

Annotations
@Nullable
requestHeadersback to summary
public HttpHeaders requestHeaders()

Returns inbound HttpHeaders

Returns:HttpHeaders

inbound HttpHeaders

schemeback to summary
public String scheme()

Returns the current protocol scheme

Returns:String

the protocol scheme

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

Redeclares reactor.netty5.NettyInbound.withConnection.

Doc from reactor.netty5.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