package devkit

  1. Overview
  2. Docs
Development kit - general purpose library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

1.20261006.tar.gz
md5=a39dbbce04bd5562a9b4443daf39c582
sha512=b10104b61384b2151521b785e7f3c3250134c75eae09b42cad69bc4a22a9a5e429beb891ee87cedf376c23d9c40f09d3f71c3fd48aa35df490c0f69dc17f3242

doc/devkit.core/Devkit_core/Web/Http/index.html

Module Web.HttpSource

Parameters

module IO : IO_TYPE
module Curl_IO : CURL with type 'a t = 'a IO.t

Signature

Sourcemodule IO : IO_TYPE with type 'a t = 'a IO.t
Sourceval with_curl : (Curl.t -> 'a IO.t) -> 'a IO.t
Sourceval with_curl_cache : (Curl.t -> 'a IO.t) -> 'a IO.t
Sourcetype ('body, 'ret) request_ = ('body, 'ret IO.t) http_request_
Sourcetype 'ret request = 'ret IO.t http_request
Sourceval http_request_k : result:((Curl.t * (int * string, Curl.curlCode) result) -> 'r) -> 'r request

this is the most general form, pass result callback to massage the result before returning from the function e.g. if you need the redirect url in case of 3xx, do http_request_k ~result:http_result

Sourceval http_request' : [> `Error of Curl.curlCode | `Ok of int * string ] request

this is the most straightforward result of http status code and content or error code

Sourceval http_request : [> `Error of string | `Ok of string ] request

even easier - content on HTTP 2xx or error message

Sourceval http_request_exn : string request

same as http_request but raise exception on non-2xx

Sourceval http_query : (string * string, [> `Error of string | `Ok of string ]) request_

send GET with a given content-type and body

Sourceval http_submit : ?verbose:bool -> ?ua:string -> ?timeout:int -> ?setup:(Curl.t -> unit) -> ?timer:Action.timer -> ?http_1_0:bool -> ?headers:string list -> ?action:http_action -> string -> (string * string) list -> [> `Error of string | `Ok of string ] IO.t

send POST with key-value form parameters