BinaryPart
is a single part decoded from a multipart/form-data body by
Multipart.parse-bytes. It carries the same
fields as a FormPart, but its body is an (Array Byte), so
it survives the NUL bytes a binary upload carries.
body
(Fn [(Ref BinaryPart a)] (Ref (Array Byte) a))
gets the body property of a BinaryPart.
content-type
(Fn [(Ref BinaryPart a)] (Ref (Maybe String) a))
gets the content-type property of a BinaryPart.
delete
(Fn [BinaryPart] ())
deletes a BinaryPart. Should usually not be called manually.
filename
(Fn [(Ref BinaryPart a)] (Ref (Maybe String) a))
gets the filename property of a BinaryPart.
init
(Fn [String, (Maybe String), (Maybe String), (Array Byte)] BinaryPart)
creates a BinaryPart.
set-body
(Fn [BinaryPart, (Array Byte)] BinaryPart)
sets the body property of a BinaryPart.
set-body!
(Fn [(Ref BinaryPart a), (Array Byte)] ())
sets the body property of a BinaryPart in place.
set-content-type
(Fn [BinaryPart, (Maybe String)] BinaryPart)
sets the content-type property of a BinaryPart.
set-content-type!
(Fn [(Ref BinaryPart a), (Maybe String)] ())
sets the content-type property of a BinaryPart in place.
set-filename
(Fn [BinaryPart, (Maybe String)] BinaryPart)
sets the filename property of a BinaryPart.
set-filename!
(Fn [(Ref BinaryPart a), (Maybe String)] ())
sets the filename property of a BinaryPart in place.
set-name!
(Fn [(Ref BinaryPart a), String] ())
sets the name property of a BinaryPart in place.
to-form-part
(Fn [(Ref BinaryPart a)] FormPart)
(to-form-part p)
converts a BinaryPart into a FormPart.
The body becomes a String, and is therefore cut at its first NUL byte; only
use this on parts you know are text.
update-body
(Fn [BinaryPart, (Ref (Fn [(Array Byte)] (Array Byte) a) b)] BinaryPart)
updates the body property of a BinaryPart using a function f.
update-content-type
(Fn [BinaryPart, (Ref (Fn [(Maybe String)] (Maybe String) a) b)] BinaryPart)
updates the content-type property of a BinaryPart using a function f.
update-filename
(Fn [BinaryPart, (Ref (Fn [(Maybe String)] (Maybe String) a) b)] BinaryPart)
updates the filename property of a BinaryPart using a function f.
update-name
(Fn [BinaryPart, (Ref (Fn [String] String a) b)] BinaryPart)
updates the name property of a BinaryPart using a function f.