Binary

zio.http.FormField.Binary
final case class Binary(name: String, data: Chunk[Byte], contentType: MediaType, transferEncoding: Option[ContentTransferEncoding], filename: Option[String]) extends FormField

A binary form data part.

Value parameters

contentType

The content type of this form data part. This is the value of the Content-Type with in this part.

data

The data of this form data part. This is the data between the headers and the boundary.

name

Name of this form data part. This is the value of the name field in the Content-Disposition within this part.

transferEncoding

The transfer encoding of this form data part. This is the value of the Content-Transfer-Encoding within this part. IMPORTANT NOTE: The data is not encoded in any way relative to the provided transferEncoding. It is the responsibility of the user to encode the data accordingly.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait FormField
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited 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

Inherited from:
FormField
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

Inherited from:
FormField
def name(newName: String): FormField

Attributes

Inherited from:
FormField
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
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

Inherited from:
FormField