Packages

sealed trait Message[F[_]] extends Media[F]

Represents a HTTP Message. The interesting subclasses are Request and Response.

Self Type
Message[F]
Source
Message.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Message
  2. Media
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type Self = SelfF[F]
  2. abstract type SelfF[F2[_]] <: Message[F2[_]] { type SelfF[F3[_]] = Message.this.SelfF[F3] }

Abstract Value Members

  1. abstract def attributes: Vault
  2. abstract def body: EntityBody[F]
    Definition Classes
    MessageMedia
  3. abstract def change(httpVersion: HttpVersion = httpVersion, body: EntityBody[F] = body, headers: Headers = headers, attributes: Vault = attributes): Self
    Attributes
    protected
  4. abstract def headers: Headers
    Definition Classes
    MessageMedia
  5. abstract def httpVersion: HttpVersion

Concrete 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. def addHeader[H](h: H)(implicit arg0: Header[H, Recurring]): Self

    Add a header to these headers.

    Add a header to these headers. The header should be a type with a recurring Header instance to ensure that the new value can be appended to any existing values.

    >>> import cats.effect.IO
    >>> import org.http4s.headers.Accept
    
    >>> val req = Request[IO]().addHeader(Accept(MediaRange.`application/*`))
    >>> req.headers.get[Accept]
    Some(Accept(NonEmptyList(application/*)))
    
    >>> val req2 = req.addHeader(Accept(MediaRange.`text/*`))
    >>> req2.headers.get[Accept]
    Some(Accept(NonEmptyList(application/*, text/*)))

    */*/*/*/*/

  5. final def as[A](implicit F: MonadThrow[F], decoder: EntityDecoder[F, A]): F[A]

    Decode the Media to the specified type

    Decode the Media to the specified type

    If no valid Status has been described, allow Ok

    A

    type of the result

    decoder

    EntityDecoder used to decode the Media

    returns

    the effect which will generate the A

    Definition Classes
    Media
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. final def attemptAs[T](implicit decoder: EntityDecoder[F, T]): DecodeResult[F, T]

    Decode the Media to the specified type

    Decode the Media to the specified type

    T

    type of the result

    decoder

    EntityDecoder used to decode the Media

    returns

    the effect which will generate the DecodeResult[T]

    Definition Classes
    Media
  8. final def bodyText(implicit RT: RaiseThrowable[F], defaultCharset: Charset = DefaultCharset): Stream[F, String]
    Definition Classes
    Media
  9. final def charset: Option[Charset]
    Definition Classes
    Media
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  11. final def contentLength: Option[Long]
    Definition Classes
    Media
  12. final def contentType: Option[Content-Type]
    Definition Classes
    Media
  13. def covary[F2[x] >: F[x]]: SelfF[F2]

    Lifts this Message's body to the specified effect type.

    Lifts this Message's body to the specified effect type.

    Definition Classes
    MessageMedia
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  16. def filterHeaders(f: (Raw) ⇒ Boolean): Self

    Keep headers that satisfy the predicate

    Keep headers that satisfy the predicate

    f

    predicate

    returns

    a new message object which has only headers that satisfy the predicate

  17. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def isChunked: Boolean
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. def putHeaders(headers: ToRaw*): Self

    Add the provided headers to the existing headers, replacing those of the same header name

    Add the provided headers to the existing headers, replacing those of the same header name

    >>> import cats.effect.IO
    >>> import org.http4s.headers.Accept
    
    >>> val req = Request[IO]().putHeaders(Accept(MediaRange.`application/*`))
    >>> req.headers.get[Accept]
    Some(Accept(NonEmptyList(application/*)))
    
    >>> val req2 = req.putHeaders(Accept(MediaRange.`text/*`))
    >>> req2.headers.get[Accept]
    Some(Accept(NonEmptyList(text/*)))

    */*/*/*/

  26. def removeHeader[A](implicit h: Header[A, _]): Self
  27. def removeHeader(key: CIString): Self
  28. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  29. def toString(): String
    Definition Classes
    AnyRef → Any
  30. def trailerHeaders(implicit F: Applicative[F]): F[Headers]

    The trailer headers, as specified in Section 3.6.1 of RFC 2616.

    The trailer headers, as specified in Section 3.6.1 of RFC 2616. The resulting F might not complete until the entire body has been consumed.

  31. def transformHeaders(f: (Headers) ⇒ Headers): Self
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  35. def withAttribute[A](key: Key[A], value: A): Self

    Generates a new message object with the specified key/value pair appended to the #attributes.

    Generates a new message object with the specified key/value pair appended to the #attributes.

    A

    type of the value to store

    key

    io.chrisdavenport.vault.Key with which to associate the value

    value

    value associated with the key

    returns

    a new message object with the key/value pair appended

  36. def withAttributes(attributes: Vault): Self
  37. def withBodyStream(body: EntityBody[F]): Self

    Sets the entity body without affecting headers such as Transfer-Encoding or Content-Length.

    Sets the entity body without affecting headers such as Transfer-Encoding or Content-Length. Most use cases are better served by withEntity, which uses an EntityEncoder to maintain the headers.

  38. def withContentType(contentType: Content-Type): Self
  39. def withContentTypeOption(contentTypeO: Option[Content-Type]): Self
  40. def withEmptyBody: Self

    Set an empty entity body on this message, and remove all payload headers that make no sense with an empty body.

  41. def withEntity[T](b: T)(implicit w: EntityEncoder[F, T]): Self

    Replace the body of this message with a new body

    Replace the body of this message with a new body

    T

    type of the Body

    b

    body to attach to this method

    w

    EntityEncoder with which to convert the body to an EntityBody

    returns

    a new message with the new body

  42. def withHeaders(headers: ToRaw*): Self
  43. def withHeaders(headers: Headers): Self
  44. def withHttpVersion(httpVersion: HttpVersion): Self
  45. def withTrailerHeaders(trailerHeaders: F[Headers]): Self
  46. def withoutAttribute(key: Key[_]): Self

    Returns a new message object without the specified key in the #attributes.

    Returns a new message object without the specified key in the #attributes.

    key

    io.chrisdavenport.vault.Key to remove

    returns

    a new message object without the key

  47. def withoutContentType: Self
  48. def withoutTrailerHeaders: Self

Deprecated Value Members

  1. def withBody[T](b: T)(implicit F: Applicative[F], w: EntityEncoder[F, T]): F[Self]
    Annotations
    @deprecated
    Deprecated

    (Since version 0.19) Use withEntity

  2. def withType(t: MediaType)(implicit F: Functor[F]): Self
    Annotations
    @deprecated
    Deprecated

    (Since version 0.20.0-M2) Use withContentType(Content-Type(t)) instead

Inherited from Media[F]

Inherited from AnyRef

Inherited from Any

Ungrouped