org.vertx.scala.core

http

package http

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. http
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. final class HttpClient extends Self with TCPSupport with ClientSSLSupport

    An HTTP client that maintains a pool of connections to a specific host, at a specific port.

    An HTTP client that maintains a pool of connections to a specific host, at a specific port. The client supports pipelining of requests.

    As well as HTTP requests, the client can act as a factory for WebSocket websockets.

    If an instance is instantiated from an event loop then the handlers of the instance will always be called on that same event loop. If an instance is instantiated from some other arbitrary Java thread (i.e. when running embedded) then and event loop will be assigned to the instance and used when any of its handlers are called.

    Instances of HttpClient are thread-safe.

  2. final class HttpClientRequest extends Self with WriteStream

    Represents a client-side HTTP request.

    Represents a client-side HTTP request.

    Instances are created by an org.vertx.scala.core.http.HttpClient instance, via one of the methods corresponding to the specific HTTP methods, or the generic org.vertx.scala.core.http.HttpClient.request method.

    Once a request has been obtained, headers can be set on it, and data can be written to its body if required. Once you are ready to send the request, the end() method should be called.

    Nothing is actually sent until the request has been internally assigned an HTTP connection. The org.vertx.scala.core.http.HttpClient instance will return an instance of this class immediately, even if there are no HTTP connections available in the pool. Any requests sent before a connection is assigned will be queued internally and actually sent when an HTTP connection becomes available from the pool.

    The headers of the request are actually sent either when the end() method is called, or, when the first part of the body is written, whichever occurs first.

    This class supports both chunked and non-chunked HTTP.

    It implements org.vertx.java.core.streams.WriteStream so it can be used with org.vertx.java.core.streams.Pump to pump data with flow control.

    An example of using this class is as follows:

    
    val req = httpClient.post("/some-url", { (response: HttpClientResponse) =>
      println("Got response: " + response.statusCode)
    })
    
    req.headers().put("some-header", "hello")
        .put("Content-Length", 5)
        .write(new Buffer(Array[Byte](1, 2, 3, 4, 5)))
        .write(new Buffer(Array[Byte](6, 7, 8, 9, 10)))
        .end()
    
    
    Instances of HttpClientRequest are not thread-safe.

  3. class HttpClientResponse extends Self with ReadStream

    Represents a client-side HTTP response.

    Represents a client-side HTTP response.

    An instance is provided to the user via a org.vertx.java.core.Handler instance that was specified when one of the HTTP method operations, or the generic String, org.vertx.java.core.Handler) method was called on an instance of org.vertx.scala.core.http.HttpClient.

    It implements org.vertx.scala.core.streams.ReadStream so it can be used with org.vertx.scala.core.streams.Pump to pump data with flow control.

    Instances of this class are not thread-safe.

  4. final class HttpServer extends Self with ServerTCPSupport with ServerSSLSupport with Closeable

    An HTTP and WebSockets server

    An HTTP and WebSockets server

    If an instance is instantiated from an event loop then the handlers of the instance will always be called on that same event loop. If an instance is instantiated from some other arbitrary Java thread then an event loop will be assigned to the instance and used when any of its handlers are called.

    Instances of HttpServer are thread-safe.

  5. final class HttpServerFileUpload extends Self with ReadStream

  6. final class HttpServerRequest extends Self with ReadStream

    Represents a server-side HTTP request.

    Represents a server-side HTTP request.

    Instances are created for each request that is handled by the server and is passed to the user via the org.vertx.java.core.Handler instance registered with the org.vertx.scala.core.http.HttpServer using the method org.vertx.scala.core.http.HttpServer.requestHandler(org.vertx.java.core.Handler).

    Each instance of this class is associated with a corresponding org.vertx.scala.core.http.HttpServerResponse instance via the response field.

    It implements org.vertx.scala.core.streams.ReadStream so it can be used with org.vertx.scala.core.streams.Pump to pump data with flow control.

    Instances of this class are not thread-safe

  7. final class HttpServerResponse extends Self with WriteStream

    Represents a server-side HTTP response.

    Represents a server-side HTTP response.

    Instances of this class are created and associated to every instance of org.vertx.scala.core.http.HttpServerRequest that is created.

    It allows the developer to control the HTTP response that is sent back to the client for a particular HTTP request. It contains methods that allow HTTP headers and trailers to be set, and for a body to be written out to the response.

    It also allows files to be streamed by the kernel directly from disk to the outgoing HTTP connection, bypassing user space altogether (where supported by the underlying operating system). This is a very efficient way of serving files from the server since buffers do not have to be read one by one from the file and written to the outgoing socket.

    It implements org.vertx.scala.core.streams.WriteStream so it can be used with org.vertx.scala.core.streams.Pump to pump data with flow control.

    Instances of this class are not thread-safe

  8. type HttpVersion = java.core.http.HttpVersion

  9. class RouteMatcher extends java.core.Handler[HttpServerRequest] with (HttpServerRequest) ⇒ Unit with Self

    Not sure whether this kind of RouteMatcher should stay in Scala...

  10. final class ServerWebSocket extends Self with WebSocketBase

    Represents a server side WebSocket that is passed into a the websocketHandler of an org.vertx.scala.core.http.HttpServer

    Represents a server side WebSocket that is passed into a the websocketHandler of an org.vertx.scala.core.http.HttpServer

    Instances of this class are not thread-safe

  11. final class WebSocket extends Self with WebSocketBase

    Represents a client side WebSocket.

    Represents a client side WebSocket.

    Instances of this class are not thread-safe

  12. trait WebSocketBase extends Self with ReadStream with WriteStream

    Represents an HTML 5 Websocket

    Represents an HTML 5 Websocket

    Instances of this class are created and provided to the handler of an org.vertx.scala.core.http.HttpClient when a successful websocket connect attempt occurs.

    On the server side, the subclass org.vertx.scala.core.http.ServerWebSocket is used instead.

    It implements both org.vertx.scala.core.streams.ReadStream and org.vertx.scala.core.streams.WriteStream so it can be used with org.vertx.scala.core.streams.Pump to pump data with flow control.

    Instances of this class are not thread-safe

  13. type WebSocketVersion = java.core.http.WebSocketVersion

Value Members

  1. object HttpClient

    Factory for org.vertx.scala.core.http.HttpClient instances by wrapping a Java instance.

  2. object HttpClientRequest

    Factory for org.vertx.scala.core.http.HttpClientRequest instances, by wrapping a Java instance.

  3. object HttpClientResponse

    Factory for org.vertx.scala.core.http.HttpClient instances by wrapping a Java instance.

  4. object HttpServer

    Factory for org.vertx.scala.core.http.HttpServer instances by wrapping a Java instance.

  5. object HttpServerFileUpload

  6. object HttpServerRequest

  7. object HttpServerResponse

    Factory for org.vertx.scala.core.http.HttpServerResponse instances.

  8. object RouteMatcher

    Factory for org.vertx.scala.core.http.RouteMatcher instances.

  9. object ServerWebSocket

    Factory for org.vertx.scala.core.http.ServerWebSocket instances.

  10. object WebSocket

    Factory for org.vertx.scala.core.http.WebSocket instances.

  11. implicit def multiMapToScalaMultiMap(n: java.core.MultiMap): scala.collection.mutable.MultiMap[String, String]

    Implicit conversion for org.vertx.java.core.MultiMap to scala.collection.mutable.MultiMap.

  12. implicit def scalaMultiMapToMultiMap(n: scala.collection.mutable.MultiMap[String, String]): java.core.MultiMap

    Implicit conversion for scala.collection.mutable.MultiMap to org.vertx.java.core.MultiMap.

Inherited from AnyRef

Inherited from Any

Ungrouped