HTTP types: headers, status codes, methods, bodies, MIME types
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocaml-http: extend MDX to lib/http_version.mli

Add http_version.mli to the (mdx ...) stanza. The two examples
were broken: one had OCaml-comment annotations describing the
result, the other was a duplicate inside [val alpn_protocols]
that wasn't valid OCaml. Replaced the module-level example with a
real assert and turned the per-val one into a See-pointer.

+11 -9
+6 -1
lib/dune
··· 14 14 fmt)) 15 15 16 16 (mdx 17 - (files http_date.mli huri.mli expect_continue.mli cache_control.mli) 17 + (files 18 + http_date.mli 19 + huri.mli 20 + expect_continue.mli 21 + cache_control.mli 22 + http_version.mli) 18 23 (libraries nox-http requests uri eio eio.core eio.unix eio_main))
+5 -8
lib/http_version.mli
··· 19 19 {2 Example} 20 20 21 21 {[ 22 - (* Configure TLS with HTTP/2 preference *) 23 - let alpn = Http_version.alpn_protocols ~preferred:[Http_2; Http_1_1] in 24 - (* alpn = ["h2"; "http/1.1"] *) 22 + open Http 23 + 24 + let alpn = Http_version.alpn_protocols ~preferred:[ Http_2; Http_1_1 ] 25 + let () = assert (alpn = [ "h2"; "http/1.1" ]) 25 26 ]} *) 26 27 27 28 (** {1 Version Type} *) ··· 74 75 (** [alpn_protocols ~preferred] returns ALPN protocol identifiers in preference 75 76 order. HTTP/1.0 is filtered out (no ALPN identifier). 76 77 77 - Example: 78 - {[ 79 - alpn_protocols ~preferred:[ Http_2; Http_1_1 ] 80 - (* Returns: ["h2"; "http/1.1"] *) 81 - ]} *) 78 + See the module-level example. *) 82 79 83 80 (** {1 Version Detection} *) 84 81