com.twitter.finagle.http

Message

abstract class Message extends HttpMessage

Rich HttpMessage

Base class for Request and Response. There are both input and output methods, though only one set of methods should be used.

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

Instance Constructors

  1. new Message()

Abstract Value Members

  1. abstract def getContent(): ChannelBuffer

    Definition Classes
    HttpMessage
  2. abstract def getProtocolVersion(): HttpVersion

    Definition Classes
    HttpMessage
  3. abstract def headers(): HttpHeaders

    Definition Classes
    HttpMessage
  4. abstract def isChunked(): Boolean

    Definition Classes
    HttpMessage
  5. abstract def isRequest: Boolean

  6. abstract def setChunked(arg0: Boolean): Unit

    Definition Classes
    HttpMessage
  7. abstract def setContent(arg0: ChannelBuffer): Unit

    Definition Classes
    HttpMessage
  8. abstract def setProtocolVersion(arg0: HttpVersion): Unit

    Definition Classes
    HttpMessage
  9. abstract def addHeader(arg0: String, arg1: Any): Unit

    Definition Classes
    HttpMessage
    Annotations
    @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

  10. abstract def clearHeaders(): Unit

    Definition Classes
    HttpMessage
    Annotations
    @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

  11. abstract def containsHeader(arg0: String): Boolean

    Definition Classes
    HttpMessage
    Annotations
    @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

  12. abstract def getHeader(arg0: String): String

    Definition Classes
    HttpMessage
    Annotations
    @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

  13. abstract def getHeaderNames(): Set[String]

    Definition Classes
    HttpMessage
    Annotations
    @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

  14. abstract def getHeaders(): List[Entry[String, String]]

    Definition Classes
    HttpMessage
    Annotations
    @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

  15. abstract def getHeaders(arg0: String): List[String]

    Definition Classes
    HttpMessage
    Annotations
    @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

  16. abstract def removeHeader(arg0: String): Unit

    Definition Classes
    HttpMessage
    Annotations
    @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

  17. abstract def setHeader(arg0: String, arg1: Iterable[_]): Unit

    Definition Classes
    HttpMessage
    Annotations
    @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

  18. abstract def setHeader(arg0: String, arg1: Any): Unit

    Definition Classes
    HttpMessage
    Annotations
    @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def accept: Seq[String]

    Accept header

  7. def acceptMediaTypes: Seq[String]

    Accept header media types (normalized, no parameters)

  8. def accept_=(values: Iterable[String]): Unit

    Set Accept header with list of values

  9. def accept_=(value: String): Unit

    Set Accept header

  10. def addCookie(cookie: Cookie): Unit

    Add a cookie

  11. def allow: Option[String]

    Allow header

  12. def allow_=(values: Iterable[HttpMethod]): Unit

    Set Authorization header

  13. def allow_=(value: String): Unit

    Set Authorization header

  14. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  15. def authorization: Option[String]

    Get Authorization header

  16. def authorization_=(value: String): Unit

    Set Authorization header

  17. def cacheControl: Option[String]

    Get Cache-Control header

  18. def cacheControl_=(maxAge: Duration): Unit

    Set Cache-Control header with a max-age (and must-revalidate).

  19. def cacheControl_=(value: String): Unit

    Set Cache-Control header

  20. def charset: Option[String]

    Get charset from Content-Type header

  21. def charset_=(value: String): Unit

    Set charset in Content-Type header.

    Set charset in Content-Type header. This does not change the content.

  22. def clearContent(): Unit

    Clear content (set to "").

  23. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  24. def close(): Future[Unit]

    End the response stream.

  25. def content: ChannelBuffer

  26. def contentLength: Option[Long]

    Get Content-Length header.

    Get Content-Length header. Use length to get the length of actual content.

  27. def contentLength_=(value: Long): Unit

    Set Content-Length header.

    Set Content-Length header. Normally, this is automatically set by the Codec, but this method allows you to override that.

  28. def contentString: String

    Get the content as a string.

  29. def contentString_=(value: String): Unit

    Set the content as a string.

  30. def contentType: Option[String]

    Get Content-Type header

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

    Set Content-Type header

  32. def content_=(content: ChannelBuffer): Unit

  33. lazy val cookies: CookieMap

    Cookies.

    Cookies. In a request, this uses the Cookie headers. In a response, it uses the Set-Cookie headers.

  34. def date: Option[String]

    Get Date header

  35. def date_=(value: Date): Unit

    Set Date header by Date

  36. def date_=(value: String): Unit

    Set Date header

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

    Definition Classes
    AnyRef
  38. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  39. def expires: Option[String]

    Get Expires header

  40. def expires_=(value: Date): Unit

    Set Expires header by Date

  41. def expires_=(value: String): Unit

    Set Expires header

  42. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  44. def getContentString(): String

  45. def getCookies(): Iterator[Cookie]

    Get iterator over Cookies

  46. def getInputStream(): InputStream

    Get InputStream for content.

    Get InputStream for content. Caller must close. (Java interface. Scala users should use withInputStream.)

  47. def getLength(): Int

  48. def getReader(): Reader

    Get Reader for content.

    Get Reader for content. (Java interface. Scala users should use withReader.)

  49. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  50. lazy val headerMap: HeaderMap

  51. def host: Option[String]

    Get Host header

  52. def host_=(value: String): Unit

    Set Host header

  53. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  54. def isResponse: Boolean

  55. def isXmlHttpRequest: Boolean

    Check if X-Requested-With contains XMLHttpRequest, usually signalling a request from a JavaScript AJAX libraries.

    Check if X-Requested-With contains XMLHttpRequest, usually signalling a request from a JavaScript AJAX libraries. Some servers treat these requests specially. For example, an endpoint might render JSON or XML instead HTML if it's an XmlHttpRequest. (Tip: don't do this - it's gross.)

  56. def lastModified: Option[String]

    Get Last-Modified header

  57. def lastModified_=(value: Date): Unit

    Set Last-Modified header by Date

  58. def lastModified_=(value: String): Unit

    Set Last-Modified header

  59. def length: Int

    Get length of content.

  60. def location: Option[String]

    Get Location header

  61. def location_=(value: String): Unit

    Set Location header

  62. def mediaType: Option[String]

    Get media-type from Content-Type header

  63. def mediaType_=(value: String): Unit

    Set media-type in Content-Type header.

    Set media-type in Content-Type header. Charset and parameter values are preserved, though may not be appropriate for the new media type.

  64. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  67. def reader: Reader

    A read-only handle to the internal stream of bytes, representing the message body.

    A read-only handle to the internal stream of bytes, representing the message body. See com.twitter.util.Reader for more information.

  68. def referer: Option[String]

    Get Referer [sic] header

  69. def referer_=(value: String): Unit

    Set Referer [sic] header

  70. def removeCookie(name: String): Unit

    Remove a cookie

  71. def retryAfter: Option[String]

    Get Retry-After header

  72. def retryAfter_=(value: Long): Unit

    Set Retry-After header by seconds

  73. def retryAfter_=(value: String): Unit

    Set Retry-After header

  74. def server: Option[String]

    Get Server header

  75. def server_=(value: String): Unit

    Set Server header

  76. def setContentString(value: String): Unit

  77. def setContentType(mediaType: String, charset: String = "utf-8"): Unit

    Set Content-Type header by media-type and charset

  78. def setContentTypeJson(): Unit

    Set Content-Type header to application/json;charset=utf-8

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

    Definition Classes
    AnyRef
  80. def toString(): String

    Definition Classes
    AnyRef → Any
  81. def userAgent: Option[String]

    Get User-Agent header

  82. def userAgent_=(value: String): Unit

    Set User-Agent header

  83. def version: HttpVersion

  84. def version_=(version: HttpVersion): Unit

  85. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  88. def withInputStream[T](f: (InputStream) ⇒ T): T

    Use content as InputStream.

    Use content as InputStream. The underlying channel buffer's reader index is advanced. (Scala interface. Java users can use getInputStream().)

  89. def withOutputStream[T](f: (OutputStream) ⇒ T): T

    Use content as OutputStream.

    Use content as OutputStream. Content is replaced with stream contents. (Java users can use this with a Function, or use Netty's ChannelBufferOutputStream and then call setContent() with the underlying buffer.)

  90. def withReader[T](f: (Reader) ⇒ T): T

    Use content as Reader.

    Use content as Reader. (Scala interface. Java usrs can use getReader().)

  91. def withWriter[T](f: (Writer) ⇒ T): T

    Use as a Writer.

    Use as a Writer. Content is replaced with writer contents.

  92. def write(buffer: ChannelBuffer): Unit

    Append ChannelBuffer to content.

    Append ChannelBuffer to content.

    If isChunked then multiple writes must be composed using writer and flatMap to have the appropriate backpressure semantics.

    Attempting to write after calling close will result in a thrown com.twitter.util.Reader.ReaderDiscarded.

    Annotations
    @throws( classOf[BufReader.ReaderDiscarded] ) @throws( classOf[IllegalStateException] )
  93. def write(bytes: Array[Byte]): Unit

    Append bytes to content.

  94. def write(string: String): Unit

    Append string to content.

  95. def writer: Writer

    A write-only handle to the internal stream of bytes, representing the message body.

    A write-only handle to the internal stream of bytes, representing the message body. See com.twitter.util.Writer for more information.

  96. def wwwAuthenticate: Option[String]

    Get WWW-Authenticate header

  97. def wwwAuthenticate_=(value: String): Unit

    Set WWW-Authenticate header

  98. def xForwardedFor: Option[String]

    Get X-Forwarded-For header

  99. def xForwardedFor_=(value: String): Unit

    Set X-Forwarded-For header

Inherited from HttpMessage

Inherited from AnyRef

Inherited from Any

Ungrouped