Interface ServerRequest
- All Superinterfaces:
HttpRequest
- All Known Subinterfaces:
JsonRpcRequest, RoutingRequest
HTTP server request.
-
Method Summary
Modifier and TypeMethodDescriptioncontent()Server request entity.context()Context of this web server request, to set and get information.booleanWhether we have already sent theStatus.CONTINUE_100when expect continue is present.booleanisSecure()Whether this request was over a secure protocol (TLS).Listener context.The pattern used to match this request.path()Path of the request.Access proxy protocol data for the connection on which this request was sent.voidreset()Reset request related state on the connection if any.security()HTTP security associated with this listener, configured on routing.Identification of the listener socket.Configured virtual-host host that matched the TLS Server Name Indication (SNI) requested host.Normalized DNS host name requested by the client using TLS Server Name Indication (SNI).socketId()Identification of the client/server connection socket.voidstreamFilter(UnaryOperator<InputStream> filterFunction) Configure a custom input stream to wrap the input stream of the request.Methods inherited from interface HttpRequest
authority, header, headers, id, localPeer, prologue, query, remotePeer, requestedUriModifier and TypeMethodDescriptionThe content of theHeaderNames.HOSTheader orauthoritypseudo header (HTTP/2).voidReplace (or set) a request header.headers()Headers of the request.intid()Request ID on this connection.Peer info of the local side.prologue()Prologue of the request.query()Query of the request.Peer info of the remote peer.URI as requested by the originating client (to the best of our ability to compute it).
-
Method Details
-
reset
void reset()Reset request related state on the connection if any. -
isSecure
boolean isSecure()Whether this request was over a secure protocol (TLS).- Returns:
- whether this is a secure request
-
path
RoutedPath path()Path of the request.- Specified by:
pathin interfaceHttpRequest- Returns:
- routed path to obtain parameters from path pattern
-
content
-
socketId
String socketId()Identification of the client/server connection socket. The socket id is not guaranteed to be unique across server instances, or between restarts.- Returns:
- socket id of this connection
-
serverSocketId
String serverSocketId()Identification of the listener socket. The listener id is not guaranteed to be unique across server instances, or between restarts.- Returns:
- server socket id
-
context
Context context()Context of this web server request, to set and get information. The context is not registered as the current context! You can use a dedicated module (helidon-webserver-context) to add a filter that would execute all requests within a context.- Returns:
- request context
-
listenerContext
ListenerContext listenerContext()Listener context. This gives access to low level tools of Helidon WebServer, please use with care.- Returns:
- listener context
-
security
HttpSecurity security()HTTP security associated with this listener, configured on routing.- Returns:
- security
- See Also:
-
continueSent
boolean continueSent()Whether we have already sent theStatus.CONTINUE_100when expect continue is present. This method returnstruefor cases where expect continue is not set. This method returnsfalsefor requests without entity.- Returns:
- whether 100-Continue was sent back to client
-
streamFilter
Configure a custom input stream to wrap the input stream of the request.- Parameters:
filterFunction- the function to replace input stream of this request with a user provided one
-
proxyProtocolData
Optional<ProxyProtocolData> proxyProtocolData()Access proxy protocol data for the connection on which this request was sent.- Returns:
- proxy protocol data, if available
- See Also:
-
sniRequestedHost
Normalized DNS host name requested by the client using TLS Server Name Indication (SNI).This value comes from the client TLS handshake, so it is suitable for diagnostics and application choices that are expected to use client-requested host names, but it should not be treated as a trusted identity by itself.
- Returns:
- normalized SNI requested host, if available
-
sniMatchedHost
Configured virtual-host host that matched the TLS Server Name Indication (SNI) requested host.For wildcard virtual hosts, this method returns the configured wildcard host such as
*.example.com.- Returns:
- configured SNI matched host, if a virtual host matched
-
matchingPattern
The pattern used to match this request. Such as "/foo/{bar}".- Returns:
- matching pattern or
Optional.empty()if not available
-