package devkit

  1. Overview
  2. Docs

web utilities

val log : Log.logger
val rawurlencode : string -> string

percent-encode (convert space into %20)

val urlencode : string -> string

percent-encode, but convert space into plus, not %20

val rawurldecode : string -> string

percent-decode (leave plus as is)

val urldecode : string -> string

percent-decode and convert plus into space

val htmlencode : string -> string
val htmldecode_exn : string -> string
val htmldecode : string -> string
val htmldecode_relaxed : string -> string
val make_url_args : (string * string) list -> string
val parse_url_args : string -> (string * string) list

Minimum strictness, Neturl will fail on malformed parameters in url

val url_get_args : string -> (string * string) list
val curl_times : Curl.t -> (string * float) list
module CurlCache : sig ... end
val curl_default_setup : Curl.t -> unit
type http_action_old = [
  1. | `GET
  2. | `POST_FORM of (string * string) list
  3. | `POST of string * string
  4. | `PUT of string * string
  5. | `DELETE
  6. | `CUSTOM of string * string * string
]
type http_body = [
  1. | `Raw of string * string
  2. | `Form of (string * string) list
  3. | `Chunked of string * (unit -> string)
]
type http_action = [
  1. | `GET
  2. | `POST
  3. | `PUT
  4. | `PATCH
  5. | `DELETE
  6. | `CUSTOM of string
]
val string_of_http_action : http_action -> string
val http_action_of_string : string -> http_action
module type IO_TYPE = sig ... end
module type CURL = sig ... end
type ('body, 'ret) http_request_ = ?ua:string -> ?timeout:int -> ?verbose:bool -> ?setup:(Curl.t -> unit) -> ?timer:Action.timer -> ?max_size:int -> ?http_1_0:bool -> ?headers:string list -> ?body:'body -> http_action -> string -> 'ret
type 'ret http_request = ([ `Form of (string * string) list | `Raw of string * string ], 'ret) http_request_
module type HTTP = sig ... end
val show_result : ?verbose:bool -> [< `Error of Curl.curlCode | `Ok of int * string ] -> string
val simple_result : ?is_ok:(int -> bool) -> ?verbose:bool -> [< `Error of Curl.curlCode | `Ok of int * string Ok ] -> [> `Error of string | `Ok of string ]
val nr_http : int ref
module Http (IO : IO_TYPE) (Curl_IO : CURL with type 'a t = 'a IO.t) : HTTP with type 'a IO.t = 'a IO.t
module IO_blocking : sig ... end
module IO_lwt : sig ... end
module Curl_blocking : sig ... end
module Curl_lwt_for_http : sig ... end
module Http_blocking : sig ... end
module Http_lwt : sig ... end
val with_curl : (Curl.t -> 'a Http_blocking.IO.t) -> 'a Http_blocking.IO.t
val with_curl_cache : (Curl.t -> 'a Http_blocking.IO.t) -> 'a Http_blocking.IO.t
val http_request' : [> `Error of Curl.curlCode | `Ok of int * string ] Http_blocking.request
val http_request : [> `Error of string | `Ok of string ] Http_blocking.request
val http_request_exn : string Http_blocking.request
val http_query : (string * string, [> `Error of string | `Ok of string ]) Http_blocking.request_
val http_submit : ?ua:string -> ?timeout:int -> ?verbose:bool -> ?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 ] Http_blocking.IO.t
val http_request_lwt' : [> `Error of Curl.curlCode | `Ok of int * string ] Http_lwt.request
val http_request_lwt : [> `Error of string | `Ok of string ] Http_lwt.request
val http_request_lwt_exn : string Http_lwt.request
val http_query_lwt : (string * string, [> `Error of string | `Ok of string ]) Http_lwt.request_
val http_submit_lwt : ?ua:string -> ?timeout:int -> ?verbose:bool -> ?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 ] Http_lwt.IO.t
val string_of_http_code : int -> string
val class_of_http_code : int -> string
OCaml

Innovation. Community. Security.