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

instantiate

(Fn [(Ref BinaryPart a)] (Ref (Array Byte) a))

gets the body property of a BinaryPart.

content-type

instantiate

(Fn [(Ref BinaryPart a)] (Ref (Maybe String) a))

gets the content-type property of a BinaryPart.

copy

instantiate

(Fn [(Ref BinaryPart a)] BinaryPart)

copies a BinaryPart.

delete

instantiate

(Fn [BinaryPart] ())

deletes a BinaryPart. Should usually not be called manually.

filename

instantiate

(Fn [(Ref BinaryPart a)] (Ref (Maybe String) a))

gets the filename property of a BinaryPart.

init

instantiate

(Fn [String, (Maybe String), (Maybe String), (Array Byte)] BinaryPart)

creates a BinaryPart.

name

instantiate

(Fn [(Ref BinaryPart a)] (Ref String a))

gets the name property of a BinaryPart.

prn

instantiate

(Fn [(Ref BinaryPart a)] String)

converts a BinaryPart to a string.

set-body

instantiate

(Fn [BinaryPart, (Array Byte)] BinaryPart)

sets the body property of a BinaryPart.

set-body!

instantiate

(Fn [(Ref BinaryPart a), (Array Byte)] ())

sets the body property of a BinaryPart in place.

set-content-type

instantiate

(Fn [BinaryPart, (Maybe String)] BinaryPart)

sets the content-type property of a BinaryPart.

set-content-type!

instantiate

(Fn [(Ref BinaryPart a), (Maybe String)] ())

sets the content-type property of a BinaryPart in place.

set-filename

instantiate

(Fn [BinaryPart, (Maybe String)] BinaryPart)

sets the filename property of a BinaryPart.

set-filename!

instantiate

(Fn [(Ref BinaryPart a), (Maybe String)] ())

sets the filename property of a BinaryPart in place.

set-name

instantiate

(Fn [BinaryPart, String] BinaryPart)

sets the name property of a BinaryPart.

set-name!

instantiate

(Fn [(Ref BinaryPart a), String] ())

sets the name property of a BinaryPart in place.

str

instantiate

(Fn [(Ref BinaryPart a)] String)

converts a BinaryPart to a string.

to-form-part

defn

(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

instantiate

(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

instantiate

(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

instantiate

(Fn [BinaryPart, (Ref (Fn [(Maybe String)] (Maybe String) a) b)] BinaryPart)

updates the filename property of a BinaryPart using a function f.

update-name

instantiate

(Fn [BinaryPart, (Ref (Fn [String] String a) b)] BinaryPart)

updates the name property of a BinaryPart using a function f.