FormField

zio.http.FormField
See theFormField companion object
sealed trait FormField

Represents a field in a form. Every field contains name, content type (perhaps just plaintext), type-specific content, and an optional filename.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Binary
class Simple
class Text

Members list

Value members

Abstract methods

def filename: Option[String]
def name: String

Concrete methods

final def asChunk(implicit trace: Trace): ZIO[Any, Nothing, Chunk[Byte]]

Gets the value of this form field as a chunk of bytes. If it is a text field, the value gets encoded as an UTF-8 byte stream.

Gets the value of this form field as a chunk of bytes. If it is a text field, the value gets encoded as an UTF-8 byte stream.

Attributes

final def asText(implicit trace: Trace): ZIO[Any, CharacterCodingException, String]

Gets the value of this form field as a String. If it is a binary field, the value is interpreted as an UTF-8 byte stream.

Gets the value of this form field as a String. If it is a binary field, the value is interpreted as an UTF-8 byte stream.

Attributes

def name(newName: String): FormField
final def stringValue: Option[String]

Gets the value as a String, but only if it is a text or simple field. For binary fields it returns None.

Gets the value as a String, but only if it is a text or simple field. For binary fields it returns None.

Attributes