abstract class Proxy extends Response
- Alphabetic
- By Inheritance
- Proxy
- Response
- Message
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Proxy()
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addCookie(cookie: Cookie): Unit
Add a cookie
Add a cookie
- Definition Classes
- Message
- def allow: Option[String]
Allow header
Allow header
- Definition Classes
- Message
- def allow_=(values: Iterable[Method]): Unit
Set Allow header
Set Allow header
- Definition Classes
- Message
- def allow_=(value: String): Unit
Set Allow header
Set Allow header
- Definition Classes
- Message
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def cacheControl: Option[String]
Get Cache-Control header
Get Cache-Control header
- Definition Classes
- Message
- def cacheControl_=(maxAge: Duration): Unit
Set Cache-Control header with a max-age (and must-revalidate).
Set Cache-Control header with a max-age (and must-revalidate).
- Definition Classes
- Message
- def cacheControl_=(value: String): Unit
Set Cache-Control header
Set Cache-Control header
- Definition Classes
- Message
- def charset: Option[String]
Get charset from Content-Type header
Get charset from Content-Type header
- Definition Classes
- Message
- def charset_=(value: String): Unit
Set charset in Content-Type header.
Set charset in Content-Type header. This does not change the content.
- Definition Classes
- Message
- def chunkReader: Reader[Chunk]
A read-only handle to a stream of Chunk, representing the message body.
A read-only handle to a stream of Chunk, representing the message body. This stream is only populated on chunked messages (
isChunked == true
). Use content to access a payload of a fully-buffered message (isChunked == false
).Prefer this API over reader when application needs to receive trailing headers (trailers). Trailers are transmitted in the very last chunk (
chunk.isLast == true
) of the stream and can be retrieved via Chunk.trailers. - def chunkWriter: Writer[Chunk]
A write-only handle to a stream of Chunk, representing the message body.
A write-only handle to a stream of Chunk, representing the message body. Only chunked messages (
isChunked == true
) use this stream as their payload, fully-buffered messages (isChunked == false
) use content instead.Prefer this API over writer when application needs to send trailing headers (trailers). Trailers are transmitted in the very last chunk of the stream and can be populated via
Chunk.last
factory method. - final def clearContent(): Unit
Clear content (set to "").
Clear content (set to "").
- Definition Classes
- Message
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def close(): Future[Unit]
End the response stream.
End the response stream.
- Definition Classes
- Message
- final def content: Buf
Retrieve the current content of this
Message
. - final def content(content: Buf): Proxy.this.type
Set the content of this
Message
.Set the content of this
Message
.Any existing content is discarded. If this
Message
is set to chunked, anIllegalStateException
is thrown.- Definition Classes
- Message
- Annotations
- @throws(scala.this.throws.<init>$default$1[IllegalStateException])
- See also
content_=(Buf) for Scala users
- final def contentLength(value: Long): Proxy.this.type
Set Content-Length header.
Set Content-Length header. Normally, this is automatically set by the Codec, but this method allows you to override that.
- Definition Classes
- Message
- See also
contentLength_=(Long) for Scala users.
- def contentLength: Option[Long]
Get the value of the Content-Length header.
Get the value of the Content-Length header. Use length to get the length of actual content.
- Definition Classes
- Message
- See also
Long for Java users.
- final def contentLengthOrElse(default: Long): Long
Get the value of the Content-Length header, or the provided default if it doesn't exist.
Get the value of the Content-Length header, or the provided default if it doesn't exist.
- Definition Classes
- Message
- See also
Option(Long) for Scala users.
- 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.
- Definition Classes
- Message
- See also
contentLength(Long) for Java users.
- def contentString: String
Get the content as a string.
Get the content as a string.
- Definition Classes
- Message
- def contentString_=(value: String): Unit
Set the content as a string.
Set the content as a string.
- Definition Classes
- Message
- def contentType: Option[String]
Get Content-Type header
Get Content-Type header
- Definition Classes
- Message
- def contentType_=(value: String): Unit
Set Content-Type header
Set Content-Type header
- Definition Classes
- Message
- final def content_=(content: Buf): Unit
Set the content of this
Message
. - lazy val cookies: CookieMap
Cookies.
- def ctx: Record
Arbitrary user-defined context associated with this response object.
Arbitrary user-defined context associated with this response object. RecordSchema.Record is used here, rather than com.twitter.finagle.context.Context or similar out-of-band mechanisms, to make the connection between the response and its associated context explicit.
- def date: Option[String]
Get Date header
Get Date header
- Definition Classes
- Message
- def date_=(value: Date): Unit
Set Date header by Date
Set Date header by Date
- Definition Classes
- Message
- def date_=(value: String): Unit
Set Date header
Set Date header
- Definition Classes
- Message
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def expires: Option[String]
Get Expires header
Get Expires header
- Definition Classes
- Message
- def expires_=(value: Date): Unit
Set Expires header by Date
Set Expires header by Date
- Definition Classes
- Message
- def expires_=(value: String): Unit
Set Expires header
Set Expires header
- Definition Classes
- Message
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getContentString(): String
- Definition Classes
- Message
- def getCookies(): Iterator[Cookie]
Get iterator over Cookies
Get iterator over Cookies
- Definition Classes
- Message
- final def getInputStream(): InputStream
Get InputStream for content.
Get InputStream for content. Caller must close. (Java interface. Scala users should use withInputStream.)
- Definition Classes
- Message
- final def getLength(): Int
Get length of content.
Get length of content.
- Definition Classes
- Message
- final def getReader(): Reader
Get Reader for content.
Get Reader for content. (Java interface. Scala users should use withReader.)
- Definition Classes
- Message
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def headerMap: HeaderMap
HTTP headers associated with this message.
- final def isChunked: Boolean
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def isRequest: Boolean
- def isResponse: Boolean
- Definition Classes
- Message
- 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.)
- Definition Classes
- Message
- final def keepAlive: Boolean
- Definition Classes
- Message
- final def keepAlive(keepAlive: Boolean): Proxy.this.type
- Definition Classes
- Message
- def lastModified: Option[String]
Get Last-Modified header
Get Last-Modified header
- Definition Classes
- Message
- def lastModified_=(value: Date): Unit
Set Last-Modified header by Date
Set Last-Modified header by Date
- Definition Classes
- Message
- def lastModified_=(value: String): Unit
Set Last-Modified header
Set Last-Modified header
- Definition Classes
- Message
- final def length: Int
Get length of content.
Get length of content.
- Definition Classes
- Message
- def location: Option[String]
Get Location header
Get Location header
- Definition Classes
- Response
- def location_=(value: String): Unit
Set Location header
Set Location header
- Definition Classes
- Response
- def mediaType: Option[String]
Get media-type from Content-Type header
Get media-type from Content-Type header
- Definition Classes
- Message
- 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.
- Definition Classes
- Message
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final lazy val reader: Reader[Buf]
A read-only handle to a stream of Buf, representing the message body.
A read-only handle to a stream of Buf, representing the message body. This stream is only * populated on chunked messages (
isChunked == true
). Use content to access a payload of a fully-buffered message (isChunked == false
).Prefer this API over chunkReader when application doesn't need access to trailing headers (trailers).
- Definition Classes
- Message
- See also
Reader
- def removeCookie(name: String): Unit
Remove a cookie
Remove a cookie
- Definition Classes
- Message
- def retryAfter: Option[String]
Get Retry-After header
Get Retry-After header
- Definition Classes
- Response
- def retryAfter_=(value: Long): Unit
Set Retry-After header by seconds
Set Retry-After header by seconds
- Definition Classes
- Response
- def retryAfter_=(value: String): Unit
Set Retry-After header
Set Retry-After header
- Definition Classes
- Response
- def server: Option[String]
Get Server header
Get Server header
- Definition Classes
- Response
- def server_=(value: String): Unit
Set Server header
Set Server header
- Definition Classes
- Response
- final def setChunked(chunked: Boolean): Unit
Manipulate the
Message
content mode.Manipulate the
Message
content mode.If
chunked
istrue
, any existing content will be discarded and further attempts to manipulate the synchronous content will result in anIllegalStateException
.If
chunked
isfalse
, the synchronous content methods will become available and theReader
/Writer
of the message will be ignored by Finagle. - final def setContentString(value: String): Unit
Set the content as a string.
Set the content as a string.
- Definition Classes
- Message
- def setContentType(mediaType: String, charset: String = "utf-8"): Unit
Set Content-Type header by media-type and charset
Set Content-Type header by media-type and charset
- Definition Classes
- Message
- def setContentTypeJson(): Unit
Set Content-Type header to application/json;charset=utf-8
Set Content-Type header to application/json;charset=utf-8
- Definition Classes
- Message
- final def status: Status
- final def status(value: Status): Proxy.this.type
Set the status of this response
Set the status of this response
- Definition Classes
- Response
- Note
See status_=(Status) for Scala users.
- final def statusCode(value: Int): Proxy.this.type
Set the status code of this response
Set the status code of this response
- Definition Classes
- Response
- Note
See statusCode_=(Int) for Scala users.
- final def statusCode: Int
Get the status code of this response
Get the status code of this response
- Definition Classes
- Response
- final def statusCode_=(value: Int): Unit
Set the status code of this response
Set the status code of this response
- Definition Classes
- Response
- Note
See statusCode(Int) for Java users.
- final def status_=(value: Status): Unit
Set the status of this response
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- Response → AnyRef → Any
- def trailers: HeaderMap
Trailing headers (trailers) associated with this message.
Trailing headers (trailers) associated with this message.
These are only populated on fully-buffered inbound messages that were aggregated (see
withStreaming(false)
) from HTTP streams terminating with trailers. - final def version: Version
Get the HTTP version
- final def version(version: Version): Proxy.this.type
Set the HTTP version
Set the HTTP version
* @see version_=(Version) for Scala users
- Definition Classes
- Message
- final def version_=(version: Version): Unit
Set the HTTP version
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- 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().)
- Definition Classes
- Message
- final def withOutputStream[T](f: (OutputStream) => T): T
Append content via an OutputStream.
Append content via an OutputStream.
An
IllegalStateException
is thrown if this message is chunked.- Definition Classes
- Message
- Annotations
- @throws(classOf[IllegalStateException])
- final def withReader[T](f: (Reader) => T): T
Use content as Reader.
Use content as Reader. (Scala interface. Java users can use getReader().)
- Definition Classes
- Message
- final def withWriter[T](f: (Writer) => T): T
Append content via a Writer.
Append content via a Writer.
An
IllegalStateException
is thrown if this message is chunked.- Definition Classes
- Message
- Annotations
- @throws(classOf[IllegalStateException])
- final def write(bytes: Array[Byte]): Unit
Append bytes to content.
Append bytes to content.
This method makes a defensive copy of the provided byte array. This can be avoided by wrapping the byte array via
Buf.ByteArray.Owned
and using thewrite(Buf)
method.An
IllegalStateException
is thrown if this message is chunked.- Definition Classes
- Message
- Annotations
- @throws(classOf[IllegalStateException])
- final def write(buf: Buf): Unit
Append a Buf to content.
Append a Buf to content.
An
IllegalStateException
is thrown if this message is chunked.- Definition Classes
- Message
- Annotations
- @throws(classOf[IllegalStateException])
- final def write(string: String): Unit
Append string to content.
Append string to content.
An
IllegalStateException
is thrown if this message is chunked.- Definition Classes
- Message
- Annotations
- @throws(classOf[IllegalStateException])
- final lazy val writer: Writer[Buf]
A write-only handle to the stream of Buf, representing the message body.
A write-only handle to the stream of Buf, representing the message body. Only chunked messages (
isChunked == true
) use this stream as their payload, fully-buffered messages (isChunked == false
) use content instead.Prefer this API over chunkWriter when application doesn't need to send trailing headers (trailers).
- Definition Classes
- Message
- See also
Writer
- def wwwAuthenticate: Option[String]
Get WWW-Authenticate header
Get WWW-Authenticate header
- Definition Classes
- Response
- def wwwAuthenticate_=(value: String): Unit
Set WWW-Authenticate header
Set WWW-Authenticate header
- Definition Classes
- Response