Returns the new Input
wrapping a given payload.
Returns the new Input
wrapping a given payload. This requires the content-type as a first
type parameter (won't be inferred).
import io.finch._, io.circe._
val text = Input.post("/").withBody[Text.Plain]("Text Body")
val json = Input.post("/").withBody[Application.Json](Map("json" -> "object"))
Also possible to create chunked inputs passing a stream as an argument.
import io.finch._, io.finch.iteratee._, cats.effect.IO, io.iteratee.Enumerator
import io.finch.circe._, io.circe.generic.auto._
val enumerateText = Enumerator.enumerate[IO, String]("foo", "bar") val text = Input.post("/").withBody[Text.Plain](enumerateText)
val enumerateJson = Enumerate.enumerate[IO, Map[String, String]](Map("foo" - "bar"))
val json = Input.post("/").withBody[Application.Json](enumerateJson)
Returns the new Input
wrapping a given application/x-www-form-urlencoded
payload.
Returns the new Input
wrapping a given application/x-www-form-urlencoded
payload.
In addition to media type, this will also set charset to UTF-8.
Returns the new Input
with headers
amended.
Returns the new Input
wrapping a given route
.
An input for Endpoint that glues two individual pieces together:
- Finagle's Request needed for evaluating (e.g.,
body
,param
) - Finch's route (represented asSeq[String]
) needed for matching (e.g.,path
)