case class Content(stream: Stream[IO, Byte], headers: Map[HttpString, HttpString] = Map.empty) extends Product with Serializable
An HTTP message content body.
It is used to represent the content body for both HTTP requests & responses. It is composed
of a lazy stream of byte that can be consumed if needed, and a set of content-related HTTP headers
(such as Content-Length
, Content-Type
, etc.).
The provided stream is not pure and can only be consumed once.
- stream
an
fs2.Stream
ofByte
.- headers
a set of content-related HTTP headers.
- Source
- Content.scala
- Alphabetic
- By Inheritance
- Content
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
Content(stream: Stream[IO, Byte], headers: Map[HttpString, HttpString] = Map.empty)
- stream
an
fs2.Stream
ofByte
.- headers
a set of content-related HTTP headers.
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
addHeaders(newHeaders: (HttpString, HttpString)*): Content
Add new HTTP headers to this content.
Add new HTTP headers to this content.
- newHeaders
the set of new HTTP header names and values to add to this content.
- returns
a copy of the content with the new headers added.
-
def
as[A](implicit decoder: ContentDecoder[A]): IO[A]
Create an
cats.effect.IO
that consumes this stream to a value of typeA
.Create an
cats.effect.IO
that consumes this stream to a value of typeA
.- decoder
the lol.http.ContentDecoder is able to read stream as values of type
A
.- returns
an
cats.effect.IO
that can be run to consume the stream.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val headers: Map[HttpString, HttpString]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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()
-
def
removeHeaders(headerNames: HttpString*): Content
Remove HTTP headers from this content.
Remove HTTP headers from this content.
- headerNames
the set of HTTP headers names to remove fromt this content.
- returns
a copy of the content without the removed headers.
- val stream: Stream[IO, Byte]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )