org.mashupbots.socko.events

HttpResponseMessage

case class HttpResponseMessage(event: HttpEvent) extends Product with Serializable

Encapsulates all the data to be sent to the client in an HTTP response; i.e. headers and content.

event

Event associated with this response

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. HttpResponseMessage
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HttpResponseMessage(event: HttpEvent)

    event

    Event associated with this response

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. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def contentType: Option[String]

    Content type as MIME code.

    Content type as MIME code. e.g. image/gif. None if not set

  7. def contentType_=(value: String): Unit

    Sets the content type header for this HTTP response

    Sets the content type header for this HTTP response

    value

    MIME type. e.g. image/gif.

  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. val event: HttpEvent

    Event associated with this response

  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. val headers: MutableHttpHeaders

    Headers

  13. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  17. def redirect(url: String): Unit

    Redirects the browser to the specified URL using the 302 HTTP status code.

    Redirects the browser to the specified URL using the 302 HTTP status code.

    Request

    GET /index.html HTTP/1.1
    Host: www.example.com

    Response

    HTTP/1.1 302 Found
    Location: http://www.newurl.org/

    Redirection is NOT buffered. The response is immediately sent to the client.

    Calling redirect() more than once results in an exception being thrown because only 1 response is permitted per request.

    url

    URL to which the browser will be redirected

  18. var status: HttpResponseStatus

    HTTP Response Status

  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def totalChunkSize: Int

    Aggregate number of bytes sent the client as chunks

  21. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. def write(status: HttpResponseStatus, content: Array[Byte], contentType: String, headers: Map[String, String]): Unit

    Sends a binary HTTP response to the client

    Sends a binary HTTP response to the client

    This write is NOT buffered. The response is immediately sent to the client.

    Calling write() more than once results in an exception being thrown because only 1 response is permitted per request.

    status

    HTTP Status

    content

    Binary data to send in the response body

    contentType

    MIME content type to set in the response header. For example, "image/gif"

    headers

    Headers to add to the HTTP response. It will be added to the headers map.

  25. def write(status: HttpResponseStatus, content: String): Unit

    Sends a HTTP response to the client with the status as well as a text message.

    Sends a HTTP response to the client with the status as well as a text message. This is typically used for in the event of an error.

    status

    HTTP Status

    content

    String to send in the response body. The MIME type will be set to text/plain; charset=UTF-8. If null or empty string, no content will be sent to the client.

  26. def write(status: HttpResponseStatus, headers: Map[String, String]): Unit

    Sends a HTTP response to the client with the status and optional headers.

    Sends a HTTP response to the client with the status and optional headers.

    Example use could be sending a 201 with status header.

    This write is NOT buffered. The response is immediately sent to the client.

    Calling write() more than once results in an exception being thrown because only 1 response is permitted per request.

    status

    HTTP Status

    headers

    Headers to add to the HTTP response. It will be added to the headers map.

  27. def write(status: HttpResponseStatus): Unit

    Sends a HTTP response to the client with just the status and not content.

    Sends a HTTP response to the client with just the status and not content. This is typically used for an error.

    This write is NOT buffered. The response is immediately sent to the client.

    Calling write() more than once results in an exception being thrown because only 1 response is permitted per request.

    status

    HTTP Status

  28. def write(content: Array[Byte], contentType: String, headers: Map[String, String]): Unit

    Sends a binary HTTP response to the client

    Sends a binary HTTP response to the client

    This write is NOT buffered. The response is immediately sent to the client.

    Calling write() more than once results in an exception being thrown because only 1 response is permitted per request.

    content

    Binary data to send in the response body.

    contentType

    MIME content type

    headers

    Headers to add to the HTTP response. It will be added to the headers map.

  29. def write(content: Array[Byte], contentType: String): Unit

    Sends a binary HTTP response to the client

    Sends a binary HTTP response to the client

    This write is NOT buffered. The response is immediately sent to the client.

    Calling write() more than once results in an exception being thrown because only 1 response is permitted per request.

    content

    Binary data to send in the response body.

    contentType

    MIME content type

  30. def write(content: String, contentType: String, headers: Map[String, String]): Unit

    Sends a string HTTP response to the client

    Sends a string HTTP response to the client

    This write is NOT buffered. The response is immediately sent to the client.

    Calling write() more than once results in an exception being thrown because only 1 response is permitted per request.

    content

    String to send in the response body

    contentType

    MIME content type. If the charset is not set, UTF-8 is assumed

    headers

    Headers to add to the HTTP response.

  31. def write(content: String, contentType: String): Unit

    Sends a string HTTP response to the client

    Sends a string HTTP response to the client

    This write is NOT buffered. The response is immediately sent to the client.

    Calling write() more than once results in an exception being thrown because only 1 response is permitted per request.

    content

    String to send in the response body

    contentType

    MIME content type. If the charset is not set, UTF-8 is assumed

  32. def write(content: String): Unit

    Sends a string HTTP response to the client

    Sends a string HTTP response to the client

    The content type will default to text/plain; charset=UTF-8 if not already set in the headers.

    This write is NOT buffered. The response is immediately sent to the client.

    Calling write() more than once results in an exception being thrown because only 1 response is permitted per request.

    content

    String to send in the response body

  33. def write(content: Array[Byte]): Unit

    Sends a binary HTTP response to the client.

    Sends a binary HTTP response to the client.

    This write is NOT buffered. The response is immediately sent to the client.

    Calling write() more than once results in an exception being thrown because only 1 response is permitted per request.

    content

    Bytes to send

  34. def write100Continue(): Unit

    Sends a 100 continue to the client

  35. def writeChunk(chunkContent: Array[Byte]): Unit

    Sends a chunk of data to the client.

    Sends a chunk of data to the client.

    This method must be called AFTER writeFirstChunk().

    Writing the a chunk is NOT buffered. The chunk is immediately sent to the client.

  36. def writeFirstChunk(status: HttpResponseStatus, contentType: String, headers: Map[String, String]): Unit

    Initiates a HTTP chunk response to the client

    Initiates a HTTP chunk response to the client

    Use this method to initiate the response. Call writeChunk() to send the individual chunks and finish by calling writeLastChunk().

    Writing the first chunk is NOT buffered. The chunk is immediately sent to the client.

    Calling writeFirstChunk() more than once results in an exception being thrown because only 1 response is permitted per request.

    status

    HTTP response status

    contentType

    MIME content type to set in the response header. For example, "image/gif". If omitted, the content type set in headers will be used.

    headers

    Headers to add to the HTTP response.

  37. def writeFirstChunk(contentType: String = "", headers: Map[String, String] = Map.empty[String, String]): Unit

    Initiates a HTTP chunk response to the client

    Initiates a HTTP chunk response to the client

    Use this method to initiate the response. Call writeChunk() to send the individual chunks and finish by calling writeLastChunk().

    Writing the first chunk is NOT buffered. The chunk is immediately sent to the client.

    Calling writeFirstChunk() more than once results in an exception being thrown because only 1 response is permitted per request.

    contentType

    MIME content type to set in the response header. For example, "image/gif". If omitted, the content type set in headers will be used.

    headers

    Headers to add to the HTTP response.

  38. def writeLastChunk(trailingHeaders: Map[String, String] = Map.empty[String, String]): Unit

    Sends a chunk to the client.

    Sends a chunk to the client.

    This method must be called AFTER the last writeChunk().

    Writing the last chunk is NOT buffered. The last chunk is immediately sent to the client.

    Calling writeLastChunk() more than once will result in an exception being throw.

    trailingHeaders

    Trailing headers

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped