FormData
object FormDataConstructors, adapters, and decoding failures for FormData.
Defined by scalive.FormData. View source (scalive/api/src/scalive/forms/FormData.scala:103-283)
Methods5
apply
def apply(raw: IterableOnce[(String, String)]): FormDataConsumes raw once and stores all pairs in encounter order.
Defined by scalive.FormData.apply. View source (scalive/api/src/scalive/forms/FormData.scala:165-166)
fromMap
def fromMap(values: Map[String, String]): FormDataCreates form data from a map.
A map cannot represent duplicate names, and pair order is whatever its iterator provides.
Defined by scalive.FormData.fromMap. View source (scalive/api/src/scalive/forms/FormData.scala:172-173)
fromUrlEncoded
def fromUrlEncoded(value: String): Either[FormData.RepresentationError, FormData]Decodes an application/x-www-form-urlencoded value as UTF-8.
Pair and duplicate order are retained. + decodes to a space, a pair without = has an empty
value, and malformed percent encoding produces InvalidUrlEncoding.
Defined by scalive.FormData.fromUrlEncoded. View source (scalive/api/src/scalive/forms/FormData.scala:180-181)
fromUrlEncodedBody
def fromUrlEncodedBody(body: zio.http.Body, maxBytes: Long): zio.package.IO[FormData.DecodeError, FormData]Reads and decodes a bounded URL-encoded HTTP body.
The body media type must match application/x-www-form-urlencoded. A declared charset is
used, defaulting to UTF-8. At most maxBytes + 1 bytes are consumed so oversized streaming
bodies can be detected; no partial form is returned. maxBytes must be from zero through
Long.MaxValue - 1, inclusive.
Body size and stream failures are wrapped in Body, while media type and URL
decoding failures are wrapped in Representation.
Throws
IllegalArgumentExceptionwhen
maxBytesis outside the supported range
Defined by scalive.FormData.fromUrlEncodedBody. View source (scalive/api/src/scalive/forms/FormData.scala:196-226)
fromZioHttpForm
def fromZioHttpForm(form: zio.http.Form): Either[FormData.RepresentationError, FormData]Converts simple and text fields from a ZIO HTTP form.
Fields and duplicate values retain the form's iteration order. Encountering the first binary
or streaming binary field returns UnsupportedField instead of partial
data; streaming fields are not consumed. Text-field media metadata is not retained.
Defined by scalive.FormData.fromZioHttpForm. View source (scalive/api/src/scalive/forms/FormData.scala:234-252)
Values1
empty
val empty: FormDataEmpty form data.
Defined by scalive.FormData.empty. View source (scalive/api/src/scalive/forms/FormData.scala:162-162)