···
+
* Copyright (c) 2014, OCaml.org project
+
* Copyright (c) 2015 KC Sivaramakrishnan <sk826@cl.cam.ac.uk>
+
* Permission to use, copy, modify, and distribute this software for any
+
* purpose with or without fee is hereby granted, provided that the above
+
* copyright notice and this permission notice appear in all copies.
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
(** River HTTP client using Requests library.
+
This module provides a session-based HTTP client for fetching RSS/Atom feeds.
+
The client manages a Requests session with appropriate defaults for feed fetching. *)
+
(** The type of a River HTTP client *)
+
(** [create ~sw env] creates a new River client with a Requests session.
+
The session is configured with:
+
- User-Agent: "OCaml-River/1.0"
+
- Automatic redirect following (max 5 redirects)
+
- TLS verification enabled
+
@param sw The switch for resource management
+
@param env The Eio environment providing network and time resources *)
+
< clock : float Eio.Time.clock_ty Eio.Resource.t;
+
fs : Eio.Fs.dir_ty Eio.Path.t;
+
net : [ `Generic | `Unix ] Eio.Net.ty Eio.Resource.t; .. > ->
+
(** [with_client env f] creates a client and automatically manages its lifecycle.
+
This is the recommended way to use the client as it ensures proper cleanup.
+
@param env The Eio environment
+
@param f The function to run with the client *)
+
< clock : float Eio.Time.clock_ty Eio.Resource.t;
+
fs : Eio.Fs.dir_ty Eio.Path.t;
+
net : [ `Generic | `Unix ] Eio.Net.ty Eio.Resource.t; .. > ->
+
(** [session t] returns the underlying Requests session.
+
This is used internally by River's HTTP functions. *)
+
val session : t -> (float Eio.Time.clock_ty Eio.Resource.t,
+
[`Generic | `Unix] Eio.Net.ty Eio.Resource.t) Requests.t