Package

com.twitter.finagle

http

Permalink

package http

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. http
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed abstract class Chunk extends AnyRef

    Permalink

    Represents a piece of an HTTP stream, commonly referred to as a chunk.

    Represents a piece of an HTTP stream, commonly referred to as a chunk.

    HTTP semantics treat trailing headers as the end of stream signal hence no writes (neither trailers nor data) are allowed after them, only close (EOS) is valid. This is typically enforced by an HTTP dispatcher in both clients and servers.

    Similarly, when consumed via com.twitter.io.Reader, trailers are always followed by None, readers's EOS. Users MUST read until the end of stream to ensure resource hygiene.

    The following example demonstrates one way of doing so: wiring in one extra read before returning from a read-loop:

    def accumulate(r: Reader[Chunk]): Future[(Buf, Option[HeaderMap])] = {
      def loop(acc: Buf, trailers: Option[HeaderMap]): Future[(Buf, Option[HeaderMap])] =
        r.read().flatMap {
          case Some(chunk) =>
            if (chunk.isLast && !chunk.trailers.isEmpty)
              loop(acc.concat(chunk.content), Some(chunk.trailers))
            else
              loop(acc.concat(chunk.content), None)
          case None =>
            Future.value(acc -> trailers)
        }
    
      loop(Buf.Empty, None)
    }

    The HTTP dispatcher guarantees that Chunk.Last will be issued in the inbound stream no matter if its trailers or content present.

    Note: when consuming interleaved HTTP streams (i.e., via Reader.flatMap) it's expected to observe multiple trailers before reaching the EOS. These inter-stream trailers space out individual HTTP streams from child readers.

  2. final class Cookie extends AnyRef

    Permalink

    Note

    domain and path may be null.

  3. class CookieMap extends Map[String, Cookie] with MapLike[String, Cookie, CookieMap]

    Permalink

    Adapt cookies of a Message to a mutable Map where cookies are indexed by their name.

    Adapt cookies of a Message to a mutable Map where cookies are indexed by their name. Requests use the Cookie header and Responses use the Set-Cookie header. If a cookie is added to the CookieMap, a header is automatically added to the Message. You can add the same cookie more than once. Use getAll to retrieve all of them, otherwise only the first one is returned. If a cookie is removed from the CookieMap, a header is automatically removed from the message

  4. final case class FileElement(name: String, content: Buf, contentType: Option[String] = None, filename: Option[String] = None) extends FormElement with Product with Serializable

    Permalink
  5. sealed abstract class FormElement extends AnyRef

    Permalink
  6. abstract class HeaderMap extends Map[String, String] with MapLike[String, String, HeaderMap]

    Permalink

    Mutable message headers map.

    Mutable message headers map.

    Header names are case-insensitive. For example, get("accept") is the same as get("Accept").

    The map is a multi-map. Use getAll to get all values for a key. Use add to append a key-value.

  7. class MapParamMap extends ParamMap

    Permalink

    Map-backed ParamMap.

  8. abstract class Message extends AnyRef

    Permalink

    Rich Message

    Rich Message

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

  9. final class Method extends AnyRef

    Permalink

    Represents the HTTP method.

    Represents the HTTP method.

    The method is a case-sensitive string defined as part of the request line of the HTTP protocol.

    See also

    https://tools.ietf.org/html/rfc7230#section-3.1.1

  10. abstract class ParamMap extends Map[String, String] with MapLike[String, String, ParamMap]

    Permalink

    Request parameter map.

    Request parameter map.

    This is a persistent (immutable) multi-map.

    Use getAll() to get all values for a key.

  11. case class ProxyCredentials(username: String, password: String) extends Product with Serializable

    Permalink
  12. abstract class Request extends Message

    Permalink

    Rich HttpRequest.

    Rich HttpRequest.

    Use RequestProxy to create an even richer subclass.

  13. class RequestParamMap extends ParamMap

    Permalink

    Http Request-backed ParamMap.

    Http Request-backed ParamMap. This ParamMap contains both parameters provided as part of the request URI and parameters provided as part of the request body.

    Note

    Request body parameters are considered if the following criteria are true:

    1. The request is not a TRACE request. 2. The request media type is 'application/x-www-form-urlencoded' 3. The content length is greater than 0.
  14. abstract class RequestProxy extends Proxy

    Permalink

    Proxy for Request.

    Proxy for Request. This can be used to create a richer request class.

  15. abstract class Response extends Message

    Permalink

    Rich HttpResponse

  16. abstract class ResponseProxy extends Proxy

    Permalink

    Proxy for Response.

    Proxy for Response. This can be used to create a richer response class.

  17. final case class SimpleElement(name: String, content: String) extends FormElement with Product with Serializable

    Permalink
  18. case class Status(code: Int) extends Product with Serializable

    Permalink

    Represents an HTTP status code.

    Represents an HTTP status code.

    The set of commonly known HTTP status codes have an associated reason phrase (see reasons). We don't provide a way to set the reason phrase because:

    - it simplifies construction (users only supply the code) - it avoids the need to validate user-defined reason phrases - it omits the possibility of statuses with duplicate reason phrases

    The only downside is that we lose the ability to create custom statuses with "vanity" reason phrases, but this should be tolerable.

  19. final class TooLongMessageException extends ChannelException with FailureFlags[TooLongMessageException]

    Permalink

    The Message was too long to be handled correctly

  20. final class Uri extends AnyRef

    Permalink

    Represents an immutable URI.

  21. final case class Version extends Product with Serializable

    Permalink

    Represents the HTTP version.

Value Members

  1. object Chunk

    Permalink
  2. object Cookie

    Permalink
  3. object EmptyParamMap extends ParamMap

    Permalink

    Empty ParamMap

  4. object Fields

    Permalink
  5. object HeaderMap

    Permalink
  6. object HttpTracing

    Permalink
  7. object MapParamMap

    Permalink
  8. object MediaType

    Permalink
  9. object Message

    Permalink
  10. object Method

    Permalink
  11. object ParamMap

    Permalink
  12. object ProxyCredentials extends Serializable

    Permalink
  13. object Request

    Permalink
  14. object Response

    Permalink
  15. object Status extends Serializable

    Permalink
  16. object TooLongMessageException extends Serializable

    Permalink
  17. object Uri

    Permalink
  18. object Version extends Serializable

    Permalink
  19. package codec

    Permalink
  20. package collection

    Permalink
  21. package cookie

    Permalink
  22. package exp

    Permalink
  23. package filter

    Permalink
  24. package param

    Permalink
  25. object serverErrorsAsFailures extends GlobalFlag[Boolean]

    Permalink
  26. package util

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped