package piaf
An HTTP library with HTTP/2 support written entirely in OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
piaf-0.2.0.tbz
sha256=07fa9009a52faeaae6d86116e75007f5279b185c7bc7c95aab9455f2107370fb
sha512=dfde4bd0a5c8a3b795a8e3d6f6e1f9f1864a9eb0a1b96763c17515d771566af7623ca64db671a8dce2c7838dad08d8465db98f5e4f8dcf5e1a386ef5b29da56c
doc/src/piaf.multipart/pp.ml.html
Source file pp.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
module Multipart_form = Piaf_multipart_form.Multipart_form let pp_extension formatter t = let payload = match t with `Ietf_token x | `X_token x -> x in Format.fprintf formatter "%s" payload let pp_ty = Multipart_form.Content_type.Type.pp let pp_subty formatter t = let payload = match t with `Ietf_token x | `Iana_token x | `X_token x -> x in Format.fprintf formatter "%s" payload let pp_content_type formatter { Multipart_form.Content_type.ty; subty; _ } = Format.fprintf formatter "%a/%a" pp_ty ty pp_subty subty let pp_value formatter t = let ty, payload = match t with | Multipart_form.Content_type.Parameters.String x -> "String", x | Token x -> "Token", x in Format.fprintf formatter "%s: %s" ty payload let pp_disposition_type formatter t = let ty = match t with | `Inline -> "inline" | `Attachment -> "attachment" | (`Ietf_token _ | `X_token _) as ext -> Format.asprintf "%a" pp_extension ext in Format.fprintf formatter "%s" ty let pp_unstructured formatter t = let pp_one formatter (t : Unstrctrd.elt) = let s = match t with | `Uchar u -> Format.asprintf "Uchar: %c" (Uchar.to_char u) | `CR -> "CR" | `LF -> "LF" | `WSP s -> Format.asprintf "WSP: %s" (s :> string) | `FWS wsp -> Format.asprintf "FWS: %s" (wsp :> string) | `d0 -> "d0" | `OBS_NO_WS_CTL obs -> Format.asprintf "OB_NO_WS_CTL: %c" (obs :> char) | `Invalid_char invalid_char -> Format.asprintf "Invalid_char: %c" (invalid_char :> char) in Format.fprintf formatter "%s" s in Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "; ") pp_one formatter t let pp_field formatter t = let open Multipart_form.Field in match t with | Field (_, Content_type, { ty; subty; parameters }) -> Format.fprintf formatter "Content-Type { ty: %a; subty: %a; params: [ %a ] }" pp_ty ty pp_subty subty (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "; ") (fun fmt (name, value) -> Format.fprintf fmt "%s, %a" name pp_value value)) parameters | Field (_, Content_encoding, enc) -> Format.fprintf formatter "Encoding: %a" Multipart_form.Content_encoding.pp enc | Field (_, Content_disposition, dispo) -> Format.fprintf formatter "Content-Disposition: %a" Multipart_form.Content_disposition.pp dispo | Field (field_name, Field, unstructured) -> Format.fprintf formatter "Field (%a, %a)" Multipart_form.Field_name.pp field_name pp_unstructured (unstructured :> Unstrctrd.elt list) (* let rec pp_contents formatter t = *) (* let pp_atom formatter { Multipart_form.header; body } = *) (* Format.fprintf *) (* formatter *) (* "{ fields: [ %a ]; contents: %a }" *) (* (Format.pp_print_list *) (* ~pp_sep:(fun fmt () -> Format.fprintf fmt "; ") *) (* pp_field) *) (* header *) (* (pp_option ~pp:pp_contents) *) (* body *) (* in *) (* match t with *) (* | Multipart_form.Leaf x -> *) (* Format.fprintf formatter "{ Contents: %a }" pp_atom x *) (* | Multipart lst -> *) (* Format.fprintf *) (* formatter *) (* "{ Multipart: [ %a ] }" *) (* (Format.pp_print_list *) (* ~pp_sep:(fun fmt () -> Format.fprintf fmt "; ") *) (* pp_atom) *) (* lst *)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>