public interface HttpServerRequest extends ReadStream<HttpServerRequest>
Instances are created for each request that is handled by the server
and is passed to the user via the Handler
instance
registered with the HttpServer
using the method HttpServer.requestHandler(org.vertx.java.core.Handler)
.
Each instance of this class is associated with a corresponding HttpServerResponse
instance via
the response
field.
It implements ReadStream
so it can be used with
Pump
to pump data with flow control.
Instances of this class are not thread-safe
Modifier and Type | Method and Description |
---|---|
java.net.URI |
absoluteURI()
Get the absolute URI corresponding to the the HTTP request
|
HttpServerRequest |
bodyHandler(Handler<Buffer> bodyHandler)
Convenience method for receiving the entire request body in one piece.
|
HttpServerRequest |
expectMultiPart(boolean expect)
Call this with true if you are expecting a multi-part form to be submitted in the request
This must be called before the body of the request has been received
|
MultiMap |
formAttributes()
Returns a map of all form attributes which was found in the request.
|
MultiMap |
headers()
A map of all headers in the request, If the request contains multiple headers with the same key, the values
will be concatenated together into a single header with the same key value, with each value separated by a comma,
as specified here.
|
java.net.InetSocketAddress |
localAddress()
Return the local (server side) address of the server that handles the request
|
java.lang.String |
method()
The HTTP method for the request.
|
NetSocket |
netSocket()
Get a net socket for the underlying connection of this request.
|
MultiMap |
params()
Returns a map of all the parameters in the request
|
java.lang.String |
path()
The path part of the uri.
|
javax.security.cert.X509Certificate[] |
peerCertificateChain() |
java.lang.String |
query()
The query part of the uri.
|
java.net.InetSocketAddress |
remoteAddress()
Return the remote (client side) address of the request
|
HttpServerResponse |
response()
The response.
|
HttpServerRequest |
uploadHandler(Handler<HttpServerFileUpload> uploadHandler)
Set the upload handler.
|
java.lang.String |
uri()
The uri of the request.
|
HttpVersion |
version()
The HTTP version of the request
|
endHandler
dataHandler, pause, resume
exceptionHandler
HttpVersion version()
java.lang.String method()
java.lang.String uri()
java.lang.String path()
java.lang.String query()
HttpServerResponse response()
HttpServerResponse
instance attached to it. This is used
to send the response back to the client.MultiMap headers()
MultiMap params()
java.net.InetSocketAddress remoteAddress()
java.net.InetSocketAddress localAddress()
javax.security.cert.X509Certificate[] peerCertificateChain() throws javax.net.ssl.SSLPeerUnverifiedException
javax.net.ssl.SSLPeerUnverifiedException
- SSL peer's identity has not been verified.java.net.URI absoluteURI()
HttpServerRequest bodyHandler(Handler<Buffer> bodyHandler)
bodyHandler
- This handler will be called after all the body has been receivedNetSocket netSocket()
HttpServerRequest expectMultiPart(boolean expect)
expect
- HttpServerRequest uploadHandler(Handler<HttpServerFileUpload> uploadHandler)
MultiMap formAttributes()
expectMultiPart(boolean)
must be called first before trying to get the formAttributes