package devkit

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

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