Module Fetch

type ('a, 'b) result = ('a'b) Stdlib.result =
| Ok of 'a
| Error of 'b
val optdef : ('a -> 'b) -> 'a option -> 'b Js_of_ocaml.Js.optdef
val to_listf : ('a -> 'b) -> 'a Js_of_ocaml.Js.js_array Js_of_ocaml.Js.t -> 'b list
class type 'a next = object ... end
class type 'a iterator = object ... end
class type 'a array_from = object ... end
val array_from : 'a iterator Js_of_ocaml.Js.t -> 'a Js_of_ocaml.Js.js_array Js_of_ocaml.Js.t
class type headers = object ... end
type 'a promise = 'a Promise.promise Js_of_ocaml.Js.t
class type body = object ... end
class type request_init = object ... end
class type abort_signal = object ... end
class type fetch_init = object ... end
class type request = object ... end
class type response_js = object ... end
class type global_scope = object ... end
val request_js : (Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t -> request_init Js_of_ocaml.Js.t Js_of_ocaml.Js.optdef -> request Js_of_ocaml.Js.t) Js_of_ocaml.Js.constr
val header_js : headers Js_of_ocaml.Js.t Js_of_ocaml.Js.constr
val global_scope : global_scope Js_of_ocaml.Js.t Stdlib.ref
val init_worker : unit -> unit
val make_headers : (string * string) list -> headers Js_of_ocaml.Js.t
val get_headers : headers Js_of_ocaml.Js.t -> (string * string) list
type request_body =
| RBlob of Js_of_ocaml.File.blob Js_of_ocaml.Js.t
| RString of string
| RBuffer of Js_of_ocaml.Typed_array.arrayBuffer Js_of_ocaml.Js.t
| RFormData of Js_of_ocaml.Form.formData Js_of_ocaml.Js.t
| RUrlParam of (string * string) list
val request_init : ?⁠cache:string -> ?⁠credentials:string -> ?⁠headers:(string * string) list -> ?⁠integrity:string -> ?⁠meth:string -> ?⁠mode:string -> ?⁠redirect:string -> ?⁠referrer:string -> ?⁠body:request_body -> unit -> 'a Js_of_ocaml.Js.optdef
val request : ?⁠cache:string -> ?⁠credentials:string -> ?⁠headers:(string * string) list -> ?⁠integrity:string -> ?⁠meth:string -> ?⁠mode:string -> ?⁠redirect:string -> ?⁠referrer:string -> ?⁠body:request_body -> string -> request Js_of_ocaml.Js.t
val fetch_init : ?⁠cache:string -> ?⁠credentials:string -> ?⁠headers:(string * string) list -> ?⁠integrity:string -> ?⁠meth:string -> ?⁠mode:string -> ?⁠redirect:string -> ?⁠referrer:string -> ?⁠body:request_body -> ?⁠referrerPolicy:string -> ?⁠keepalive:bool -> unit -> fetch_init Js_of_ocaml.Js.t Js_of_ocaml.Js.optdef
val fetch_base : ?⁠cache:string -> ?⁠credentials:string -> ?⁠headers:(string * string) list -> ?⁠integrity:string -> ?⁠meth:string -> ?⁠mode:string -> ?⁠redirect:string -> ?⁠referrer:string -> ?⁠body:request_body -> ?⁠referrerPolicy:string -> ?⁠keepalive:bool -> string -> response_js Js_of_ocaml.Js.t promise
val fetch_request_base : request Js_of_ocaml.Js.t -> response_js Js_of_ocaml.Js.t promise
type 'a response = {
headers : (string * string) list;
ok : bool;
redirected : bool;
status : int;
status_text : string;
typ : string;
url : string;
body_used : bool;
body : 'a;
}
val (>>=?) : ('a'b) result Lwt.t -> ('a -> ('c'b) result Lwt.t) -> ('c'b) result Lwt.t
val (>|=?) : ('a'b) result Lwt.t -> ('a -> 'c) -> ('c'b) result Lwt.t
val to_lwt_str : ?⁠msg:string -> 'a Promise_lwt.promise Js_min.t -> ('a, string) result Lwt.t
val to_lwt_opt : ?⁠msg:string -> ('a -> 'b) -> 'a Js_of_ocaml.Js.Opt.t Promise_lwt.promise Js_min.t -> ('b, string) result Lwt.t
val to_array_buffer : < arrayBuffer : 'a Js_of_ocaml.Js.Opt.t Promise_lwt.promise Js_min.t Js_of_ocaml.Js.meth; .. > Js_of_ocaml.Js.t -> ('a, string) result Lwt.t
val to_blob : < blob : 'a Js_of_ocaml.Js.Opt.t Promise_lwt.promise Js_min.t Js_of_ocaml.Js.meth; .. > Js_of_ocaml.Js.t -> ('a, string) result Lwt.t
val to_form_data : < formData : 'a Js_of_ocaml.Js.Opt.t Promise_lwt.promise Js_min.t Js_of_ocaml.Js.meth; .. > Js_of_ocaml.Js.t -> ('a, string) result Lwt.t
val to_js : < json : 'a Js_of_ocaml__Js.t Js_of_ocaml.Js.Opt.t Promise_lwt.promise Js_min.t Js_of_ocaml.Js.meth; .. > Js_of_ocaml.Js.t -> ('b Js_of_ocaml__Js.t, string) result Lwt.t
val to_text : < text : Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t Js_of_ocaml.Js.Opt.t Promise_lwt.promise Js_min.t Js_of_ocaml.Js.meth; .. > Js_of_ocaml.Js.t -> (string, string) result Lwt.t
val to_response : (response_js Js_of_ocaml.Js.t -> ('a'b) result Lwt.t) -> response_js Js_of_ocaml.Js.t -> ('a response'b) result Lwt.t
val fetch : ?⁠cache:string -> ?⁠credentials:string -> ?⁠headers:(string * string) list -> ?⁠integrity:string -> ?⁠meth:string -> ?⁠mode:string -> ?⁠redirect:string -> ?⁠referrer:string -> ?⁠body:request_body -> ?⁠referrerPolicy:string -> ?⁠keepalive:bool -> string -> (response_js Js_of_ocaml.Js.t -> ('a, string) result Lwt.t) -> ('a response, string) result Lwt.t
val fetch_request : request Js_of_ocaml.Js.t -> (response_js Js_of_ocaml.Js.t -> ('a, string) result Lwt.t) -> ('a response, string) result Lwt.t