Webs.Media_typeMedia type constants and file extensions.
The type for media types.
val none : tnone is "", a content type for when there is none.
val application_json : tapplication_json is "application/json", JSON text.
val application_octet_stream : tapplication_octet_stream is "application/octet-stream", arbitrary bytes.
val application_x_www_form_urlencoded : tapplication_x_www_form_urlencoded is "application/x-www-form-urlencoded".
val text_css : ttext_css is "text/css", a CSS stylesheet.
val text_html : ttext_html is "text/html; charset=utf-8", UTF-8 encoded HTML text.
val text_javascript : ttext_jvascript is "text/javascript", JavaScript code.
val text_plain : ttext_plain is "text/plain; charset=utf-8", UTF-8 encoded plain text.
val multipart_byteranges : tmultipart_byteranges is "multipart/byteranges".
val multipart_form_data : tmultipart_form_data is "multipart/form-data".
val get_type : t -> stringget_type t is a lenient parser for the type/subtype part of the media-type t (i.e. it drops the parameters). This parses and returns one or two tokens separated by /. Can be used on lowercased Http.Headers.content_type header values to match types.
type of_file_ext_map = t Stdlib.Map.Make(Stdlib.String).tThe type for maps from file extensions to media types.
val of_file_ext : ?map:of_file_ext_map -> file_ext -> tof_file_ext ~map ext is the value of ext in map or "application/octet-stream" if ext is unbound in map. map defaults to default_file_ext_map.
val of_filepath : ?map:of_file_ext_map -> fpath -> tof_filepath ~map f is of_file_ext ~map (Http.Path.filepath_ext f).
val default_of_file_ext_map : of_file_ext_mapdefault_to_file_ext_map is a default extension to media type map. The map is documented by its implementation (sorry). Non self-describing text/* media types have the parameter charset=utf-8.
type to_file_ext_map = file_ext Stdlib.Map.Make(Stdlib.String).tThe type for maps from media types to file extensions.
val to_file_ext : ?map:to_file_ext_map -> t -> file_extto_file_ext ~map t is the value t in map or ".bin" if both t and to_type t are unbound in map. map defaults to default_to_file_ext_map.
val default_to_file_ext_map : of_file_ext_mapdefault_to_file_ex_map is a default media type to extension map. The map is documented by its implementation (sorry).