Represents a server-side HTTP request. Each instance of this class is associated with a corresponding HttpServerResponse instance via the response field. Instances of this class are not thread-safe.

By: Julien Viet

no subtypes hierarchy

HttpServerRequest(HttpServerRequest delegate)
absoluteURIshared String absoluteURI

Get the absolute URI corresponding to the the HTTP request

formAttributesshared Promise<MultiMap> formAttributes

The form attributes when the request is a POST/PUT/PATCH with a application/x-www-form-urlencoded or multipart/form-data mime type

headersshared actual MultiMap headers

The headers

methodshared String method= delegate.method()

The request method

paramsshared MultiMap params

Returns a map of all the parameters in the request.

pathshared String path

The request path

queryshared String? query

The query part of the request uri

remoteAddressshared SocketAddress remoteAddress

The remote socket address

responseshared HttpServerResponse response

The response. Each instance of this class has an HttpServerResponse instance attached to it. This is used to send the response back to the client.

streamshared actual ReadStream stream

The read stream of this request

urishared String uri

The request uri

versionshared HttpVersion version

The HTTP version of the request.

Inherited Attributes
Attributes inherited from: HttpInput
Attributes inherited from: Object
hash, string
bodyHandlershared HttpServerRequest bodyHandler(void onBody(Buffer body))

Convenience method for receiving the entire request body in one piece. This saves the user having to manually set a data and end handler and append the chunks of the body until the whole body received. Don't use this if your request body is large - you could potentially run out of RAM.

expectMultiPartshared 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

netSocketshared actual NetSocket netSocket()

Get a net socket for the underlying connection of this request. USE THIS WITH CAUTION! Writing to the socket directly if you don't know what you're doing can easily break the HTTP protocol

parseBodyshared actual Promise<Body> parseBody<Body>(BodyType<Body> parser)

Parse the input body, the returned promise is resolved with the body.

uploadHandlershared HttpServerRequest uploadHandler(void onUpload(HttpServerFileUpload upload))

Set the upload handler. The handler will get notified once a new file upload was received and so allow to get notified by the upload in progress.

Inherited Methods
Methods inherited from: Object