package piaf

  1. Overview
  2. Docs

HTTP Header.

Any part of a multipart/form-data document has a HTTP header which describes:

  • the type of contents.
  • the encoding used to transfer contents.
  • meta-data such as the associated name/key of contents.
  • some others meta information.

We allow the user to introspect the given header with useful functions.

type t
val assoc : Field_name.t -> t -> Field.field list
val exists : Field_name.t -> t -> bool
val content_type : t -> Content_type.t

content_type header returns the Content_type value of header. If this value does not exists, it return default value.

val content_encoding : t -> Content_encoding.t

content_encoding returns the Content_encoding value of header. If this value does not exists, it return default value.

val content_disposition : t -> Content_disposition.t option

content_disposition returns the Content_disposition value of header if it exists.

val to_list : t -> Field.field list

to_list hdr returns the list of fields into the given hdr header.

val of_list : Field.field list -> t

of_list lst returns a header from a list of Field.field.

val pp : t Fmt.t
module Decoder : sig ... end
OCaml

Innovation. Community. Security.