A batteries included HTTP/1.1 client in OCaml
at main 22 lines 907 B view raw
1(*--------------------------------------------------------------------------- 2 Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved. 3 SPDX-License-Identifier: ISC 4 ---------------------------------------------------------------------------*) 5 6(** Library version and User-Agent header support. Per RFC 9110 Section 10.1.5 7 and Recommendation #30: Provides a default User-Agent header for HTTP 8 requests. *) 9 10val v : string 11(** Library version string (e.g., "0.1.0"). *) 12 13val name : string 14(** Library name ("ocaml-requests"). *) 15 16val user_agent : string 17(** Default User-Agent header value. Format: "ocaml-requests/VERSION (OCaml 18 OCAML_VERSION)" Example: "ocaml-requests/0.1.0 (OCaml 5.2.0)" 19 20 Per RFC 9110 Section 10.1.5, this helps server-side debugging and 21 monitoring. The User-Agent is automatically added to requests unless the 22 user provides their own. *)