libduvet/http/multipart

Types

A file part of a multipart request.

pub type FilePart {
  FilePart(field: String, bytes: BitArray, filename: String)
}

Constructors

  • FilePart(field: String, bytes: BitArray, filename: String)

A multipart form, encoded as http.MultipartRequest encodes it in the Dart package.

pub type Form {
  Form(content_type: String, body: BitArray)
}

Constructors

  • Form(content_type: String, body: BitArray)

Values

pub fn basename(path: String) -> String

A file’s name without its folders: on Windows a path may separate them with either slash.

pub fn encode(
  fields: List(#(String, String)),
  files: List(FilePart),
) -> Form

Encodes the form, with the fields first and the files after, as Dart’s multipart encoder writes it.

pub const max_bio_length: Int

How long a bio may be once trimmed, in characters as the API counts them: Unicode code points, so an emoji such as 😀 is one.

pub fn media_type_of(filename: String) -> String

The media type a file part declares, from its name.

pub const members_page_size: Int

How many members a page of the space-members endpoint has.

pub const piece_size: Int

A request body’s bytes in pieces of at most this many bytes, so that progress and the idle timeout follow what the socket takes.

pub fn pieces(body: BitArray) -> List(BitArray)
✨ Search Document