Expect_continueHTTP 100-Continue configuration
Configuration for the HTTP 100-Continue protocol, which allows clients to check if the server will accept a request before sending a large body. Per RFC 9110 Section 10.1.1 (Expect) and Section 15.2.1 (100 Continue).
The simplest way to configure 100-continue is with the polymorphic variant:
(* Use 100-continue for bodies >= 1MB (default) *)
let session = Requests.create ~sw ~expect_100_continue:(`Threshold 1_048_576L) env
(* Always use 100-continue *)
let session = Requests.create ~sw ~expect_100_continue:`Always env
(* Disable 100-continue *)
let session = Requests.create ~sw ~expect_100_continue:`Disabled envtype config = [ | `DisabledNever use 100-continue
*)| `AlwaysAlways use 100-continue regardless of body size
*)| `Threshold of int64Use 100-continue for bodies >= threshold bytes
*) ]User-facing configuration as a polymorphic variant.
`Disabled: Never send Expect: 100-continue header`Always: Always send Expect: 100-continue for requests with bodies`Threshold n: Send Expect: 100-continue for bodies >= n bytesval default : tDefault configuration: `Threshold 1_048_576L with 1.0s timeout
val disabled : tConfiguration with 100-Continue disabled.
of_config ?timeout config creates internal configuration from user-facing config. Timeout defaults to 1.0s.
val make : ?enabled:bool -> ?threshold:int64 -> ?timeout:float -> unit -> tCreate custom 100-Continue configuration. All parameters are optional and default to the values in default.
val enabled : t -> boolWhether 100-continue is enabled.
val threshold : t -> int64Body size threshold in bytes to trigger 100-continue.
val timeout : t -> floatTimeout in seconds to wait for 100 response.
val should_use : t -> int64 -> boolshould_use t body_size returns true if 100-continue should be used for a request with the given body_size.
val pp : Format.formatter -> t -> unitPretty-printer for 100-Continue configuration.
val to_string : t -> stringConvert configuration to a human-readable string.
val pp_config : Format.formatter -> config -> unitPretty-printer for the user-facing config variant.