···
Use Eio.Fiber.both or Eio.Fiber.all for concurrent execution.
135
+
type ('clock, 'net) t
(** A stateful HTTP client that maintains cookies, auth, configuration, and
137
-
connection pools across requests. The internal clock and network types are
138
-
hidden from external users. *)
137
+
connection pools across requests. *)
(** {2 Creation and Configuration} *)
144
-
?http_pool:(([> float Eio.Time.clock_ty] as 'clock) Eio.Resource.t,
145
-
([> [> `Generic] Eio.Net.ty] as 'net) Eio.Resource.t) Conpool.t ->
146
-
?https_pool:('clock Eio.Resource.t, 'net Eio.Resource.t) Conpool.t ->
143
+
?http_pool:('clock Eio.Time.clock, 'net Eio.Net.t) Conpool.t ->
144
+
?https_pool:('clock Eio.Time.clock, 'net Eio.Net.t) Conpool.t ->
?cookie_jar:Cookeio.jar ->
?default_headers:Headers.t ->
···
< clock: 'clock Eio.Resource.t; net: 'net Eio.Resource.t; fs: Eio.Fs.dir_ty Eio.Path.t; .. > ->
160
+
('clock Eio.Resource.t, 'net Eio.Resource.t) t
(** Create a new requests instance with persistent state and connection pooling.
All resources are bound to the provided switch and will be cleaned up automatically.
···
(** {2 Configuration Management} *)
190
-
val set_default_header : t -> string -> string -> t
188
+
val set_default_header : ('clock, 'net) t -> string -> string -> ('clock, 'net) t
(** Add or update a default header. Returns a new session with the updated header.
The original session's connection pools are shared. *)
194
-
val remove_default_header : t -> string -> t
192
+
val remove_default_header : ('clock, 'net) t -> string -> ('clock, 'net) t
(** Remove a default header. Returns a new session without the header. *)
197
-
val set_auth : t -> Auth.t -> t
195
+
val set_auth : ('clock, 'net) t -> Auth.t -> ('clock, 'net) t
(** Set default authentication. Returns a new session with auth configured. *)
200
-
val clear_auth : t -> t
198
+
val clear_auth : ('clock, 'net) t -> ('clock, 'net) t
(** Clear authentication. Returns a new session without auth. *)
203
-
val set_timeout : t -> Timeout.t -> t
201
+
val set_timeout : ('clock, 'net) t -> Timeout.t -> ('clock, 'net) t
(** Set default timeout. Returns a new session with the timeout configured. *)
206
-
val set_retry : t -> Retry.config -> t
204
+
val set_retry : ('clock, 'net) t -> Retry.config -> ('clock, 'net) t
(** Set retry configuration. Returns a new session with retry configured. *)
···
285
+
(_ Eio.Time.clock, _ Eio.Net.t) t ->
···
(** Make a concurrent HTTP request *)
298
+
(_ Eio.Time.clock, _ Eio.Net.t) t ->
···
(** Concurrent GET request *)
308
+
(_ Eio.Time.clock, _ Eio.Net.t) t ->
···
(** Concurrent POST request *)
318
+
(_ Eio.Time.clock, _ Eio.Net.t) t ->
···
(** Concurrent PUT request *)
328
+
(_ Eio.Time.clock, _ Eio.Net.t) t ->
···
(** Concurrent PATCH request *)
338
+
(_ Eio.Time.clock, _ Eio.Net.t) t ->
···
(** Concurrent DELETE request *)
347
+
(_ Eio.Time.clock, _ Eio.Net.t) t ->
···
(** Concurrent HEAD request *)
356
+
(_ Eio.Time.clock, _ Eio.Net.t) t ->
···
(** {2 Cookie Management} *)
368
-
val cookies : t -> Cookeio.jar
366
+
val cookies : ('clock, 'net) t -> Cookeio.jar
(** Get the cookie jar for direct manipulation *)
371
-
val clear_cookies : t -> unit
369
+
val clear_cookies : ('clock, 'net) t -> unit
(** {1 Cmdliner Integration} *)
···
user_agent : string option; (** User-Agent header *)
396
-
val create : config ->
397
-
< clock: [> float Eio.Time.clock_ty] Eio.Resource.t;
398
-
net: [> [> `Generic] Eio.Net.ty] Eio.Resource.t;
399
-
fs: Eio.Fs.dir_ty Eio.Path.t; .. > ->
394
+
val create : config -> < clock: ([> float Eio.Time.clock_ty ] as 'clock) Eio.Resource.t; net: ([> [>`Generic] Eio.Net.ty ] as 'net) Eio.Resource.t; fs: Eio.Fs.dir_ty Eio.Path.t; .. > -> Eio.Switch.t -> ('clock Eio.Resource.t, 'net Eio.Resource.t) t
(** [create config env sw] creates a requests instance from command-line configuration *)
(** {2 Individual Terms} *)
···
463
-
val requests_term : string ->
464
-
< clock: [> float Eio.Time.clock_ty] Eio.Resource.t;
465
-
net: [> [> `Generic] Eio.Net.ty] Eio.Resource.t;
466
-
fs: Eio.Fs.dir_ty Eio.Path.t; .. > ->
467
-
Eio.Switch.t -> t Cmdliner.Term.t
457
+
val requests_term : string -> < clock: ([> float Eio.Time.clock_ty ] as 'clock) Eio.Resource.t; net: ([> [>`Generic] Eio.Net.ty ] as 'net) Eio.Resource.t; fs: Eio.Fs.dir_ty Eio.Path.t; .. > -> Eio.Switch.t -> ('clock Eio.Resource.t, 'net Eio.Resource.t) t Cmdliner.Term.t
(** [requests_term app_name env sw] creates a term that directly produces a requests instance.
This is a convenience function that combines configuration parsing