io.vertx.rxjava.core.http

## Class HttpServerRequest

- java.lang.Object
- - io.vertx.rxjava.core.http.HttpServerRequest

- All Implemented Interfaces:
    ReadStream<Buffer>, StreamBase

      public class HttpServerRequest
      extends Object
      implements ReadStream<Buffer>

  Represents a server-side HTTP request.

  Instances are created for each request and passed to the user via a handler.

  Each instance of this class is associated with a corresponding `HttpServerResponse` instance via `response()`.

  It implements `ReadStream` so it can be used with `Pump` to pump data with flow control.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpServerRequest(HttpServerRequest delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `absoluteURI()`
    `HttpServerRequest` | `bodyHandler(Handler<Buffer> bodyHandler)` Convenience method for receiving the entire request body in one piece.
    `HttpConnection` | `connection()`
    `HttpServerRequest` | `customFrameHandler(Handler<HttpFrame> handler)` Set a custom frame handler.
    `HttpServerRequest` | `endHandler(Handler<Void> endHandler)` Set an end handler.
    `HttpServerRequest` | `exceptionHandler(Handler<Throwable> handler)` Set an exception handler on the read stream.
    `MultiMap` | `formAttributes()` Returns a map of all form attributes in the request.
    `Object` | `getDelegate()`
    `String` | `getFormAttribute(String attributeName)` Return the first form attribute value with the specified name
    `String` | `getHeader(String headerName)` Return the first header value with the specified name
    `String` | `getParam(String paramName)` Return the first param value with the specified name
    `HttpServerRequest` | `handler(Handler<Buffer> handler)` Set a data handler.
    `MultiMap` | `headers()`
    `String` | `host()`
    `boolean` | `isEnded()` Has the request ended? I.e.
    `boolean` | `isExpectMultipart()`
    `boolean` | `isSSL()`
    `SocketAddress` | `localAddress()`
    `HttpMethod` | `method()`
    `NetSocket` | `netSocket()` Get a net socket for the underlying connection of this request.
    `static HttpServerRequest` | `newInstance(HttpServerRequest arg)`
    `MultiMap` | `params()`
    `String` | `path()`
    `HttpServerRequest` | `pause()` Pause the `ReadSupport`.
    `String` | `query()`
    `String` | `rawMethod()`
    `SocketAddress` | `remoteAddress()`
    `HttpServerResponse` | `response()`
    `HttpServerRequest` | `resume()` Resume reading.
    `String` | `scheme()`
    `HttpServerRequest` | `setExpectMultipart(boolean expect)` Call this with true if you are expecting a multi-part body to be submitted in the request.
    `Observable<Buffer>` | `toObservable()`
    `ServerWebSocket` | `upgrade()` Upgrade the connection to a WebSocket connection.
    `HttpServerRequest` | `uploadHandler(Handler<HttpServerFileUpload> uploadHandler)` Set an upload handler.
    `String` | `uri()`
    `HttpVersion` | `version()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface io.vertx.rxjava.core.streams.ReadStream

      `newInstance`

    - ### Methods inherited from interface io.vertx.rxjava.core.streams.StreamBase

      `newInstance`

- - ### Constructor Detail

    - #### HttpServerRequest

          public HttpServerRequest(HttpServerRequest delegate)

  - ### Method Detail

    - #### getDelegate

          public Object getDelegate()

      Specified by:
        `getDelegate` in interface `ReadStream<Buffer>`
      Specified by:
        `getDelegate` in interface `StreamBase`

    - #### toObservable

          public Observable<Buffer> toObservable()

      Specified by:
        `toObservable` in interface `ReadStream<Buffer>`

    - #### exceptionHandler

          public HttpServerRequest exceptionHandler(Handler<Throwable> handler)

      Description copied from interface: `ReadStream`
      Set an exception handler on the read stream.
      Specified by:
        `exceptionHandler` in interface `ReadStream<Buffer>`
      Specified by:
        `exceptionHandler` in interface `StreamBase`
      Parameters:
        `handler` - the exception handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### handler

          public HttpServerRequest handler(Handler<Buffer> handler)

      Description copied from interface: `ReadStream`
      Set a data handler. As data is read, the handler will be called with the data.
      Specified by:
        `handler` in interface `ReadStream<Buffer>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### pause

          public HttpServerRequest pause()

      Description copied from interface: `ReadStream`
      Pause the `ReadSupport`. While it's paused, no data will be sent to the `dataHandler`
      Specified by:
        `pause` in interface `ReadStream<Buffer>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### resume

          public HttpServerRequest resume()

      Description copied from interface: `ReadStream`
      Resume reading. If the `ReadSupport` has been paused, reading will recommence on it.
      Specified by:
        `resume` in interface `ReadStream<Buffer>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### endHandler

          public HttpServerRequest endHandler(Handler<Void> endHandler)

      Description copied from interface: `ReadStream`
      Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.
      Specified by:
        `endHandler` in interface `ReadStream<Buffer>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### version

          public HttpVersion version()

      Returns:
        the HTTP version of the request

    - #### method

          public HttpMethod method()

      Returns:
        the HTTP method for the request.

    - #### rawMethod

          public String rawMethod()

      Returns:
        the HTTP method as sent by the client

    - #### isSSL

          public boolean isSSL()

      Returns:
        true if this `NetSocket` is encrypted via SSL/TLS

    - #### scheme

          public String scheme()

      Returns:
        the scheme of the request

    - #### uri

          public String uri()

      Returns:
        the URI of the request. This is usually a relative URI

    - #### path

          public String path()

      Returns:
        The path part of the uri. For example /somepath/somemorepath/someresource.foo

    - #### query

          public String query()

      Returns:
        the query part of the uri. For example someparam=32&someotherparam=x

    - #### host

          public String host()

      Returns:
        the request host. For HTTP2 it returns the pseudo header otherwise it returns the header

    - #### response

          public HttpServerResponse response()

      Returns:
        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.

    - #### headers

          public MultiMap headers()

      Returns:
        the headers in the request.

    - #### getHeader

          public String getHeader(String headerName)

      Return the first header value with the specified name
      Parameters:
        `headerName` - the header name
      Returns:
        the header value

    - #### params

          public MultiMap params()

      Returns:
        the query parameters in the request

    - #### getParam

          public String getParam(String paramName)

      Return the first param value with the specified name
      Parameters:
        `paramName` - the param name
      Returns:
        the param value

    - #### remoteAddress

          public SocketAddress remoteAddress()

      Returns:
        the remote (client side) address of the request

    - #### localAddress

          public SocketAddress localAddress()

      Returns:
        the local (server side) address of the server that handles the request

    - #### absoluteURI

          public String absoluteURI()

      Returns:
        the absolute URI corresponding to the the HTTP request

    - #### bodyHandler

          public HttpServerRequest bodyHandler(Handler<Buffer> bodyHandler)

      Convenience method for receiving the entire request body in one piece.

      This saves the user having to manually setting 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.

      Parameters:
        `bodyHandler` - This handler will be called after all the body has been received
      Returns:

    - #### netSocket

          public NetSocket netSocket()

      Get a net socket for the underlying connection of this request.

      USE THIS WITH CAUTION!

      Once you have called this method, you must handle writing to the connection yourself using the net socket, the server request instance will no longer be usable as normal. Writing to the socket directly if you don't know what you're doing can easily break the HTTP protocol.

      Returns:
        the net socket

    - #### setExpectMultipart

          public HttpServerRequest setExpectMultipart(boolean expect)

      Call this with true if you are expecting a multi-part body to be submitted in the request. This must be called before the body of the request has been received
      Parameters:
        `expect` - true - if you are expecting a multi-part body
      Returns:
        a reference to this, so the API can be used fluently

    - #### isExpectMultipart

          public boolean isExpectMultipart()

      Returns:
        true if we are expecting a multi-part body for this request. See `setExpectMultipart(boolean)`.

    - #### uploadHandler

          public HttpServerRequest uploadHandler(Handler<HttpServerFileUpload> uploadHandler)

      Set an upload handler. The handler will get notified once a new file upload was received to allow you to deal with the file upload.
      Parameters:
        `uploadHandler` -
      Returns:
        a reference to this, so the API can be used fluently

    - #### formAttributes

          public MultiMap formAttributes()

      Returns a map of all form attributes in the request.

      Be aware that the attributes will only be available after the whole body has been received, i.e. after the request end handler has been called.

      `setExpectMultipart(boolean)` must be called first before trying to get the form attributes.

      Returns:
        the form attributes

    - #### getFormAttribute

          public String getFormAttribute(String attributeName)

      Return the first form attribute value with the specified name
      Parameters:
        `attributeName` - the attribute name
      Returns:
        the attribute value

    - #### upgrade

          public ServerWebSocket upgrade()

      Upgrade the connection to a WebSocket connection.

      This is an alternative way of handling WebSockets and can only be used if no websocket handlers are set on the Http server, and can only be used during the upgrade request during the WebSocket handshake.

      Returns:
        the WebSocket

    - #### isEnded

          public boolean isEnded()

      Has the request ended? I.e. has the entire request, including the body been read?
      Returns:
        true if ended

    - #### customFrameHandler

          public HttpServerRequest customFrameHandler(Handler<HttpFrame> handler)

      Set a custom frame handler. The handler will get notified when the http stream receives an custom HTTP/2 frame. HTTP/2 permits extension of the protocol.
      Parameters:
        `handler` -
      Returns:
        a reference to this, so the API can be used fluently

    - #### connection

          public HttpConnection connection()

      Returns:
        the `HttpConnection` associated with this request

    - #### newInstance

          public static HttpServerRequest newInstance(HttpServerRequest arg)

Copyright © 2016. All rights reserved.