ezjs_fetch

Bindings for Fetch
Module Ezjs_fetch
val optdef : ( 'a -> 'b ) -> 'c option -> 'd Ezjs_min.optdef
val to_listf : ( 'a -> 'b ) -> 'c Ezjs_min.js_array Ezjs_min.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 Ezjs_min.t -> 'a0 Ezjs_min.js_array Ezjs_min.t
class type headers = object ... end
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 global_scope : global_scope Ezjs_min.t ref
val init_worker : unit -> unit
val make_headers : (string * string) list -> headers Js_of_ocaml.Js.t
val get_headers : headers Ezjs_min.t -> (string * string) list
type request_body =
| RBlob of Ezjs_min.File.blob Ezjs_min.t
| RString of string
| RBuffer of Ezjs_min.Typed_array.arrayBuffer Ezjs_min.t
| RFormData of Js_of_ocaml.Form.formData Ezjs_min.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 Ezjs_min.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 Ezjs_min.t Ezjs_min.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 Ezjs_min.t promise
val fetch_request_base : request Ezjs_min.t -> response_js Ezjs_min.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 catch : ( ( 'a, Ezjs_min__Js.error Ezjs_min__Js.t ) Ezjs_min.result -> unit ) -> 'b Ezjs_min.Opt.t Ezjs_min.Promise.promise Ezjs_min__Js.t -> unit
type 'a body_translate = ( ( 'a, Ezjs_min.error Ezjs_min.t ) Ezjs_min.result -> unit ) -> response_js Ezjs_min.t -> unit
val to_js : 'a Ezjs_min.t body_translate
val to_text : string body_translate
val to_response : 'a body_translate -> ( ( 'a0 response, Ezjs_min.error Ezjs_min.t ) Ezjs_min.result -> unit ) -> response_js Ezjs_min.t -> unit
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 -> 'a body_translate -> ( ( 'a response, Ezjs_min.error Ezjs_min.t ) Ezjs_min.result -> unit ) -> unit
val fetch_request : request Ezjs_min.t -> 'a body_translate -> ( ( 'a response, Ezjs_min.error Ezjs_min.t ) Ezjs_min.result -> unit ) -> unit