package ezjs_fetch

  1. Overview
  2. Docs
include module type of struct include Ezjs_fetch end
module Stream = Ezjs_fetch.Stream
val optdef : ('a -> 'b) -> 'a option -> 'b Ezjs_min.optdef
val to_listf : ('a -> 'b) -> 'a 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
class type headers = object ... end
class type body = object ... end
class type request_init = 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
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 = Ezjs_fetch.request_body =
  1. | RBlob of Ezjs_min.File.blob Ezjs_min.t
  2. | RString of string
  3. | RBuffer of Ezjs_min.Typed_array.arrayBuffer Ezjs_min.t
  4. | RFormData of Js_of_ocaml.Form.formData Ezjs_min.t
  5. | 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 = 'a Ezjs_fetch.response = {
  1. headers : (string * string) list;
  2. ok : bool;
  3. redirected : bool;
  4. status : int;
  5. status_text : string;
  6. typ : string;
  7. url : string;
  8. body_used : bool;
  9. body : 'a;
}
val to_stream : ('a -> 'b Ezjs_min.t -> ('a, string option) Ezjs_min.result) -> 'a -> (('a, Ezjs_min.error Ezjs_min.t) Ezjs_min.result -> unit) -> response_js Ezjs_min.t -> unit
val to_str_stream : ('a -> string -> ('a, string option) Ezjs_min.result) -> 'a -> (('a, Ezjs_min.error Ezjs_min.t) Ezjs_min.result -> unit) -> response_js Ezjs_min.t -> unit
val (>>=?) : ('a, 'b) Ezjs_min_lwt.result Lwt.t -> ('a -> ('c, 'b) Ezjs_min_lwt.result Lwt.t) -> ('c, 'b) Ezjs_min_lwt.result Lwt.t
val (>|=?) : ('a, 'b) Ezjs_min_lwt.result Lwt.t -> ('a -> 'c) -> ('c, 'b) Ezjs_min_lwt.result Lwt.t
val to_text : string body_translate
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, Js_of_ocaml.Js.Js_error.error_t) Ezjs_min_lwt.result Lwt.t
OCaml

Innovation. Community. Security.