-
- All Superinterfaces:
HttpRequest
public interface ServerRequest extends HttpRequest
Represents HTTP Request and provides WebServer related API.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.helidon.common.http.HttpRequest
HttpRequest.Path
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default URI
absoluteUri()
Absolute URI of the incoming request, including query parameters and fragment.Single<Void>
closeConnection()
Request to close the connection and report success or failure asynchronously with returned single.MessageBodyReadableContent
content()
ReturnsMessageBodyReadableContent
reactive representation of the request content.Context
context()
Returns a request context as a child ofWebServer
context.RequestHeaders
headers()
Returns http request headers.boolean
isSecure()
Returns an indicating whether this request was made using a secure channel, such as HTTPS.String
localAddress()
Returns the Internet Protocol (IP) address of the interface on which the request was received.int
localPort()
Returns the Internet Protocol (IP) port number of the interface on which the request was received.void
next()
Continue request processing on the next registered handler.void
next(Throwable t)
Continues or enters an error branch of a request processing.String
remoteAddress()
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.int
remotePort()
Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.UriInfo
requestedUri()
URI as it was requested by the user (to the best of our knowledge).long
requestId()
A unique correlation ID that is associated with this request and its associated response.Optional<SpanContext>
spanContext()
Returns a span context related to the current request.Tracer
tracer()
WebServer
webServer()
Returns actualWebServer
instance.-
Methods inherited from interface io.helidon.common.http.HttpRequest
fragment, method, path, query, queryParams, uri, version
-
-
-
-
Method Detail
-
next
void next()
Continue request processing on the next registered handler.If error is being handled, this is identical to calling
next(Throwable)
with a cause of the error.
-
next
void next(Throwable t)
Continues or enters an error branch of a request processing. This call has identical effect to throwing the exceptiont
except that the exception is directly passed to a next registeredErrorHandler
and this it's faster.It is not possible to leave error request processing and continue in registered
Handler
.- Parameters:
t
- a cause that is directly passed to a next registeredErrorHandler
-
webServer
WebServer webServer()
Returns actualWebServer
instance.- Returns:
- actual
WebServer
instance
-
context
Context context()
Returns a request context as a child ofWebServer
context.- Returns:
- a request context
-
localAddress
String localAddress()
Returns the Internet Protocol (IP) address of the interface on which the request was received.- Returns:
- an address
-
localPort
int localPort()
Returns the Internet Protocol (IP) port number of the interface on which the request was received.- Returns:
- the port number
-
remoteAddress
String remoteAddress()
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.- Returns:
- the address of the client that sent the request
-
remotePort
int remotePort()
Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.- Returns:
- the port number.
-
isSecure
boolean isSecure()
Returns an indicating whether this request was made using a secure channel, such as HTTPS.- Returns:
true
if the request was made using a secure channel
-
headers
RequestHeaders headers()
Returns http request headers.- Returns:
- an http headers
-
content
MessageBodyReadableContent content()
ReturnsMessageBodyReadableContent
reactive representation of the request content.- Returns:
- a request content
- See Also:
MessageBodyReadableContent
-
requestId
long requestId()
A unique correlation ID that is associated with this request and its associated response.- Returns:
- a unique correlation ID associated with this request and its response
-
spanContext
Optional<SpanContext> spanContext()
Returns a span context related to the current request.SpanContext
is a tracing component from opentracing.io standard.- Returns:
- the related span context, empty if not enabled
-
tracer
Tracer tracer()
- Returns:
- the tracer associated, or
GlobalTracer.get()
-
closeConnection
Single<Void> closeConnection()
Request to close the connection and report success or failure asynchronously with returned single. After connection is closed it is not possible to use it again.- Returns:
- Single completed when connection is closed.
-
requestedUri
UriInfo requestedUri()
URI as it was requested by the user (to the best of our knowledge). By default, the information is taken fromHttp.Header.HOST
header and current request. If enabled by configuration, additional headers may be used to determine the user invoked URI (such asHttp.Header.FORWARDED
).- Returns:
- uri info that can be used for redirects
-
absoluteUri
default URI absoluteUri()
Absolute URI of the incoming request, including query parameters and fragment. The host and port are obtained from the interface this server listens on (host
header is not used).- Returns:
- the URI of incoming request
-
-