vertx-lang-scala-docs_2.12 3.4.1 API < Back
 

# Packages

-  package root
  Definition Classes
    root
-  package io
  Definition Classes
    root
-  package vertx
  Definition Classes
    io
-  package scala
  Definition Classes
    vertx
-  package core
  Definition Classes
    scala
-  package http
  Definition Classes
    core
- GoAway
- Http2Settings
- HttpClient
- HttpClientOptions
- HttpClientRequest
- HttpClientResponse
- HttpConnection
- HttpFrame
- HttpServer
- HttpServerFileUpload
- HttpServerOptions
- HttpServerRequest
- HttpServerResponse
- RequestOptions
- ServerWebSocket
- WebSocket
- WebSocketBase
- WebSocketFrame

c

io.vertx.scala.core.http

# HttpServerRequest 

###
Companion object HttpServerRequest

#### class HttpServerRequest extends 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 io.vertx.scala.core.http.HttpServerResponse instance via io.vertx.scala.core.http.HttpServerRequest#response. It implements io.vertx.scala.core.streams.ReadStream so it can be used with io.vertx.scala.core.streams.Pump to pump data with flow control.

Linear Supertypes
ReadStream[Buffer], StreamBase, AnyRef, Any
 
Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. HttpServerRequest
2. ReadStream
3. StreamBase
4. AnyRef
5. Any

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Instance Constructors

1.  new HttpServerRequest(_asJava: AnyRef)

### Value Members

1.  final def !=(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
2.  final def ##(): Int
   Definition Classes
     AnyRef → Any
3.  final def ==(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
4.  def absoluteURI(): String

   returns

     the absolute URI corresponding to the the HTTP request

5.  final def asInstanceOf[T0]: T0
   Definition Classes
     Any
6.  def asJava: AnyRef
   Definition Classes
     HttpServerRequest → ReadStream → StreamBase
7.  def bodyHandler(bodyHandler: Handler[Buffer]): HttpServerRequest

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

   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.

   bodyHandler

     This handler will be called after all the body has been received

8.  def clone(): AnyRef
   Attributes
     protected[java.lang]
   Definition Classes
     AnyRef
   Annotations
     @throws( ... )
9.  def connection(): HttpConnection

   returns

     the HttpConnection associated with this request

10.  def customFrameHandler(handler: Handler[HttpFrame]): HttpServerRequest

    Set a custom frame 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.

    returns

      a reference to this, so the API can be used fluently

11.  def endHandler(endHandler: Handler[Unit]): HttpServerRequest

    Set an end handler.

    Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.

    returns

      a reference to this, so the API can be used fluently

    Definition Classes
      HttpServerRequest → ReadStream
12.  final def eq(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
13.  def equals(arg0: Any): Boolean
    Definition Classes
      AnyRef → Any
14.  def exceptionHandler(handler: Handler[Throwable]): HttpServerRequest

    Set an exception handler on the read stream.

    Set an exception handler on the read stream.

    handler

      the exception handler

    returns

      a reference to this, so the API can be used fluently

    Definition Classes
      HttpServerRequest → ReadStream → StreamBase
15.  def finalize(): Unit
    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )
16.  def formAttributes(): MultiMap

    Returns a map of all form attributes in the request.

    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.

    io.vertx.scala.core.http.HttpServerRequest#setExpectMultipart must be called first before trying to get the form attributes.

    returns

      the form attributes

17.  final def getClass(): Class[_]
    Definition Classes
      AnyRef → Any
18.  def getFormAttribute(attributeName: String): Option[String]

    Return the first form attribute value with the specified name

    Return the first form attribute value with the specified name

    attributeName

      the attribute name

    returns

      the attribute value

19.  def getHeader(headerName: String): Option[String]

    Return the first header value with the specified name

    Return the first header value with the specified name

    headerName

      the header name

    returns

      the header value

20.  def getParam(paramName: String): Option[String]

    Return the first param value with the specified name

    Return the first param value with the specified name

    paramName

      the param name

    returns

      the param value

21.  def handler(handler: Handler[Buffer]): HttpServerRequest

    Set a data handler.

    Set a data handler. As data is read, the handler will be called with the data.

    returns

      a reference to this, so the API can be used fluently

    Definition Classes
      HttpServerRequest → ReadStream
22.  def hashCode(): Int
    Definition Classes
      AnyRef → Any
23.  def headers(): MultiMap

    returns

      the headers in the request.

24.  def host(): Option[String]

    returns

      the request host. For HTTP2 it returns the `:authority` pseudo header otherwise it returns the `Host` header

25.  def isEnded(): Boolean

    Has the request ended? I.e.

    Has the request ended? I.e. has the entire request, including the body been read?

    returns

      true if ended

26.  def isExpectMultipart(): Boolean

    returns

      true if we are expecting a multi-part body for this request. See #setExpectMultipart.

27.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
28.  def isSSL(): Boolean

    returns

      true if this io.vertx.scala.core.net.NetSocket is encrypted via SSL/TLS

29.  def localAddress(): SocketAddress

    returns

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

30.  def method(): HttpMethod

    returns

      the HTTP method for the request.

31.  final def ne(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
32.  def netSocket(): NetSocket

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

    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

33.  final def notify(): Unit
    Definition Classes
      AnyRef
34.  final def notifyAll(): Unit
    Definition Classes
      AnyRef
35.  def params(): MultiMap

    returns

      the query parameters in the request

36.  def path(): Option[String]

    returns

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

37.  def pause(): HttpServerRequest

    Pause the `ReadSupport`.

    Pause the `ReadSupport`. While it's paused, no data will be sent to the `dataHandler`

    returns

      a reference to this, so the API can be used fluently

    Definition Classes
      HttpServerRequest → ReadStream
38.  def query(): Option[String]

    returns

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

39.  def rawMethod(): String

    returns

      the HTTP method as sent by the client

40.  def remoteAddress(): SocketAddress

    returns

      the remote (client side) address of the request

41.  def response(): HttpServerResponse

    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.

42.  def resume(): HttpServerRequest

    Resume reading.

    Resume reading. If the `ReadSupport` has been paused, reading will recommence on it.

    returns

      a reference to this, so the API can be used fluently

    Definition Classes
      HttpServerRequest → ReadStream
43.  def scheme(): Option[String]

    returns

      the scheme of the request

44.  def setExpectMultipart(expect: Boolean): HttpServerRequest

    Call this with true if you are expecting a multi-part body to be submitted in the request.

    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

    expect

      true - if you are expecting a multi-part body

    returns

      a reference to this, so the API can be used fluently

45.  final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
      AnyRef
46.  def toString(): String
    Definition Classes
      AnyRef → Any
47.  def upgrade(): ServerWebSocket

    Upgrade the connection to a WebSocket connection.

    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

48.  def uploadHandler(uploadHandler: Handler[HttpServerFileUpload]): HttpServerRequest

    Set an upload handler.

    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.

    returns

      a reference to this, so the API can be used fluently

49.  def uri(): String

    returns

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

50.  def version(): HttpVersion

    returns

      the HTTP version of the request

51.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
52.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
53.  final def wait(arg0: Long): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

### Inherited from ReadStream[Buffer]

### Inherited from StreamBase

### Inherited from AnyRef

### Inherited from Any

### Ungrouped