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.
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.
Arbitrary user-defined context associated with this request object.
Arbitrary user-defined context associated with this request object. RecordSchema.Record is used here, rather than Context or similar out-of-band mechanisms, to make the connection between the request and its associated context explicit.
HTTP headers associated with this message.
Returns the HTTP method of this request.
Sets the HTTP method of this request to the given method
.
Sets the HTTP method of this request to the given method
.
* @see method(Method) for Java users.
The InetSocketAddress of the client or a place-holder ephemeral address for requests that have yet to be dispatched.
The InetSocketAddress of the client or a place-holder ephemeral address for requests that have yet to be dispatched.
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.
Returns the URI of this request.
Set the URI of this request to the given uri
.
Set the URI of this request to the given uri
.
uri(String) for Java users.
Accept header
Accept header
Accept header media types (normalized, no parameters)
Accept header media types (normalized, no parameters)
Set Accept header with list of values
Set Accept header with list of values
Set Accept header
Set Accept header
Add a cookie
Add a cookie
Allow header
Allow header
Set Authorization header
Set Authorization header
Set Authorization header
Set Authorization header
Get Authorization header
Get Authorization header
Set Authorization header
Set Authorization header
Get Cache-Control header
Get Cache-Control header
Set Cache-Control header with a max-age (and must-revalidate).
Set Cache-Control header with a max-age (and must-revalidate).
Set Cache-Control header
Set Cache-Control header
Get charset from Content-Type header
Get charset from Content-Type header
Set charset in Content-Type header.
Set charset in Content-Type header. This does not change the content.
Clear content (set to "").
Clear content (set to "").
End the response stream.
End the response stream.
Check if parameter exists.
Check if parameter exists.
params for details of which parameters are considered.
Set the content of this Message
.
Set the content of this Message
.
Any existing content is discarded. If this Message
is set to chunked,
an IllegalStateException
is thrown.
content_=(Buf) for Scala users
Retrieve the current content of this Message
.
Retrieve the current content of this Message
.
If this message is chunked, the resulting Buf
will always be empty.
Set Content-Length header.
Set Content-Length header. Normally, this is automatically set by the Codec, but this method allows you to override that.
contentLength_=(Long) for Scala users.
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.
Long for Java users.
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.
Option(Long) for Scala users.
Set Content-Length header.
Set Content-Length header. Normally, this is automatically set by the Codec, but this method allows you to override that.
contentLength(Long) for Java users.
Get the content as a string.
Get the content as a string.
Set the content as a string.
Set the content as a string.
Get Content-Type header
Get Content-Type header
Set Content-Type header
Set Content-Type header
Set the content of this Message
.
Set the content of this Message
.
Any existing content is discarded. If this Message
is set to chunked,
an IllegalStateException
is thrown.
content(Buf) for Java users
Cookies.
Cookies. In a request, this uses the Cookie headers. In a response, it uses the Set-Cookie headers.
Get Date header
Get Date header
Set Date header by Date
Set Date header by Date
Set Date header
Set Date header
Get Expires header
Get Expires header
Set Expires header by Date
Set Expires header by Date
Set Expires header
Set Expires header
File extension.
File extension. Empty string if none.
Get Boolean param.
Get Boolean param. Returns value or default.
params for details of which parameters are considered.
Get Boolean param.
Get Boolean param. Returns value or false.
params for details of which parameters are considered.
Get iterator over Cookies
Get iterator over Cookies
Get InputStream for content.
Get InputStream for content. Caller must close. (Java interface. Scala users should use withInputStream.)
Get Int param.
Get Int param. Returns value or default.
params for details of which parameters are considered.
Get Int param.
Get Int param. Returns value or 0.
params for details of which parameters are considered.
Get length of content.
Get length of content.
Get Long param.
Get Long param. Returns value or default.
params for details of which parameters are considered.
Get Long param.
Get Long param. Returns value or 0.
params for details of which parameters are considered.
Get parameter value.
Get parameter value. Returns value or default.
params for details of which parameters are considered.
Get parameter value.
Get parameter value. Returns value or null.
params for details of which parameters are considered.
Get parameters names.
Get parameters names.
params for details of which parameters are considered.
Get all parameters.
Get all parameters.
params for details of which parameters are considered.
Get all values of parameter.
Get all values of parameter. Returns list of values.
params for details of which parameters are considered.
Get Reader for content.
Get Reader for content. (Java interface. Scala users should use withReader.)
Get Short param.
Get Short param. Returns value or default.
params for details of which parameters are considered.
Get Short param.
Get Short param. Returns value or 0.
params for details of which parameters are considered.
Set the Host header
Set the Host header
host_=(String) for Scala users
Get Host header
Get Host header
Set Host header
Set Host header
host(String) for Java users
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.)
Get Last-Modified header
Get Last-Modified header
Set Last-Modified header by Date
Set Last-Modified header by Date
Set Last-Modified header
Set Last-Modified header
Get length of content.
Get length of content.
Get Location header
Get Location header
Set Location header
Set Location header
Get media-type from Content-Type header
Get media-type from Content-Type header
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.
Sets the HTTP method of this request to the given method
.
Sets the HTTP method of this request to the given method
.
method_=(Method) for Scala users.
Returns a ParamMap instance, which contains both parameters provided as part of the request URI and parameters provided as part of the request body.
Returns a ParamMap instance, which contains both parameters provided as part of the request URI and parameters provided as part of the request body.
Request body parameters are considered if the following criteria are true:
import com.twitter.finagle.http.{MediaType, Method, Request} val request = Request(Method.Post, "/search?a=yes") request.mediaType = MediaType.WwwForm request.contentString = "a=no&b=yes&c=no" request.params // Result // com.twitter.finagle.http.ParamMap = ?c=no&a=no&b=yes&a=yes
To get just query parameters from the URI, use Uri.
Path from URI.
Path from URI.
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).
Reader
Get Referer [sic] header
Get Referer [sic] header
Set Referer [sic] header
Set Referer [sic] header
Remote InetAddress
Remote InetAddress
Remote host - a dotted quad
Remote host - a dotted quad
Remote port
Remote port
Remove a cookie
Remove a cookie
Get Retry-After header
Get Retry-After header
Set Retry-After header by seconds
Set Retry-After header by seconds
Set Retry-After header
Set Retry-After header
Get Server header
Get Server header
Set Server header
Set Server header
Manipulate the Message
content mode.
Manipulate the Message
content mode.
If chunked
is true
, any existing content will be discarded and further attempts
to manipulate the synchronous content will result in an IllegalStateException
.
If chunked
is false
, the synchronous content methods will become available
and the Reader
/Writer
of the message will be ignored by Finagle.
Set the content as a string.
Set the content as a string.
Set Content-Type header by media-type and charset
Set Content-Type header by media-type and charset
Set Content-Type header to application/json;charset=utf-8
Set Content-Type header to application/json;charset=utf-8
Set the URI of this request.
Set the URI of this request.
uri_=(String) for Scala users.
Get User-Agent header
Get User-Agent header
Set User-Agent header
Set User-Agent header
Set the HTTP version
Set the HTTP version
* @see version_=(Version) for Scala users
Get the HTTP version
Get the HTTP version
Set the HTTP version
Set the HTTP version
version(Version) for Java users
Use content as InputStream.
Use content as InputStream. The underlying channel buffer's reader index is advanced. (Scala interface. Java users can use getInputStream().)
Append content via an OutputStream.
Append content via an OutputStream.
An IllegalStateException
is thrown if this message is chunked.
Use content as Reader.
Use content as Reader. (Scala interface. Java users can use getReader().)
Append content via a Writer.
Append content via a Writer.
An IllegalStateException
is thrown if this message is chunked.
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 the write(Buf)
method.
An IllegalStateException
is thrown if this message is chunked.
Append a Buf to content.
Append a Buf to content.
An IllegalStateException
is thrown if this message is chunked.
Append string to content.
Append string to content.
An IllegalStateException
is thrown if this message is chunked.
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).
Writer
Get WWW-Authenticate header
Get WWW-Authenticate header
Set WWW-Authenticate header
Set WWW-Authenticate header
Get X-Forwarded-For header
Get X-Forwarded-For header
Set X-Forwarded-For header
Set X-Forwarded-For header
Get response associated with request.
Get response associated with request.
(Since version 2016-12-29) Use the Response constructor functions
Response associated with request.
Response associated with request.
(Since version 2016-12-29) Use the Response constructor functions
Rich HttpRequest.
Use RequestProxy to create an even richer subclass.