package curl

  1. Overview
  2. Docs
Bindings to libcurl

Install

dune-project
 Dependency

Authors

Maintainers

Sources

curl-0.10.0.tbz
sha256=c14e215fda7f94292a758d9ae90f7bcbc21564c919190064011fccdcf7a12914
sha512=10e089942a496c739f9468155c992f194b315abe6c63d7f72551ff4bf052e96e5dd25b85254e3ab144d330f33ed83864b185389ffe35c2bfeeb2cbf505b47600

doc/curl/Curl/index.html

Module CurlSource

libcurl wrapper

Types

Sourcetype t
Sourcetype curlCode =
  1. | CURLE_OK
  2. | CURLE_UNSUPPORTED_PROTOCOL
  3. | CURLE_FAILED_INIT
  4. | CURLE_URL_MALFORMAT
  5. | CURLE_URL_MALFORMAT_USER
  6. | CURLE_COULDNT_RESOLVE_PROXY
  7. | CURLE_COULDNT_RESOLVE_HOST
  8. | CURLE_COULDNT_CONNECT
  9. | CURLE_FTP_WEIRD_SERVER_REPLY
  10. | CURLE_FTP_ACCESS_DENIED
  11. | CURLE_FTP_USER_PASSWORD_INCORRECT
  12. | CURLE_FTP_WEIRD_PASS_REPLY
  13. | CURLE_FTP_WEIRD_USER_REPLY
  14. | CURLE_FTP_WEIRD_PASV_REPLY
  15. | CURLE_FTP_WEIRD_227_FORMAT
  16. | CURLE_FTP_CANT_GET_HOST
  17. | CURLE_FTP_CANT_RECONNECT
  18. | CURLE_FTP_COULDNT_SET_BINARY
  19. | CURLE_PARTIAL_FILE
  20. | CURLE_FTP_COULDNT_RETR_FILE
  21. | CURLE_FTP_WRITE_ERROR
  22. | CURLE_FTP_QUOTE_ERROR
  23. | CURLE_HTTP_NOT_FOUND
  24. | CURLE_WRITE_ERROR
  25. | CURLE_MALFORMAT_USER
  26. | CURLE_FTP_COULDNT_STOR_FILE
  27. | CURLE_READ_ERROR
  28. | CURLE_OUT_OF_MEMORY
  29. | CURLE_OPERATION_TIMEOUTED
  30. | CURLE_FTP_COULDNT_SET_ASCII
  31. | CURLE_FTP_PORT_FAILED
  32. | CURLE_FTP_COULDNT_USE_REST
  33. | CURLE_FTP_COULDNT_GET_SIZE
  34. | CURLE_HTTP_RANGE_ERROR
  35. | CURLE_HTTP_POST_ERROR
  36. | CURLE_SSL_CONNECT_ERROR
  37. | CURLE_FTP_BAD_DOWNLOAD_RESUME
  38. | CURLE_FILE_COULDNT_READ_FILE
  39. | CURLE_LDAP_CANNOT_BIND
  40. | CURLE_LDAP_SEARCH_FAILED
  41. | CURLE_LIBRARY_NOT_FOUND
  42. | CURLE_FUNCTION_NOT_FOUND
  43. | CURLE_ABORTED_BY_CALLBACK
  44. | CURLE_BAD_FUNCTION_ARGUMENT
  45. | CURLE_BAD_CALLING_ORDER
  46. | CURLE_HTTP_PORT_FAILED
  47. | CURLE_BAD_PASSWORD_ENTERED
  48. | CURLE_TOO_MANY_REDIRECTS
  49. | CURLE_UNKNOWN_TELNET_OPTION
  50. | CURLE_TELNET_OPTION_SYNTAX
  51. | CURLE_OBSOLETE
  52. | CURLE_SSL_PEER_CERTIFICATE
  53. | CURLE_GOT_NOTHING
  54. | CURLE_SSL_ENGINE_NOTFOUND
  55. | CURLE_SSL_ENGINE_SETFAILED
  56. | CURLE_SEND_ERROR
  57. | CURLE_RECV_ERROR
  58. | CURLE_SHARE_IN_USE
  59. | CURLE_SSL_CERTPROBLEM
  60. | CURLE_SSL_CIPHER
  61. | CURLE_SSL_CACERT
  62. | CURLE_BAD_CONTENT_ENCODING
  63. | CURLE_LDAP_INVALID_URL
  64. | CURLE_FILESIZE_EXCEEDED
  65. | CURLE_USE_SSL_FAILED
  66. | CURLE_SEND_FAIL_REWIND
  67. | CURLE_SSL_ENGINE_INITFAILED
  68. | CURLE_LOGIN_DENIED
  69. | CURLE_TFTP_NOTFOUND
  70. | CURLE_TFTP_PERM
  71. | CURLE_REMOTE_DISK_FULL
  72. | CURLE_TFTP_ILLEGAL
  73. | CURLE_TFTP_UNKNOWNID
  74. | CURLE_REMOTE_FILE_EXISTS
  75. | CURLE_TFTP_NOSUCHUSER
  76. | CURLE_CONV_FAILED
  77. | CURLE_CONV_REQD
  78. | CURLE_SSL_CACERT_BADFILE
  79. | CURLE_REMOTE_FILE_NOT_FOUND
  80. | CURLE_SSH
  81. | CURLE_SSL_SHUTDOWN_FAILED
  82. | CURLE_AGAIN
Sourceexception CurlException of curlCode * int * string
Sourceexception NotImplemented of string

exception raised when trying to use options missing from libcurl headers, argument is the option name

Sourcetype curlNETRCOption =
  1. | CURL_NETRC_OPTIONAL
  2. | CURL_NETRC_IGNORED
  3. | CURL_NETRC_REQUIRED
Sourcetype curlEncoding =
  1. | CURL_ENCODING_NONE
  2. | CURL_ENCODING_DEFLATE
  3. | CURL_ENCODING_GZIP
  4. | CURL_ENCODING_ANY
Sourcetype curlContentType =
  1. | DEFAULT
  2. | CONTENTTYPE of string
Sourcetype curlHTTPPost =
  1. | CURLFORM_CONTENT of string * string * curlContentType
  2. | CURLFORM_FILECONTENT of string * string * curlContentType
  3. | CURLFORM_FILE of string * string * curlContentType
  4. | CURLFORM_BUFFER of string * string * string * curlContentType
Sourcetype curlSSLVersion =
  1. | SSLVERSION_DEFAULT
    (*

    attempt to figure out the remote SSL protocol version

    *)
  2. | SSLVERSION_TLSv1
    (*

    TLSv1.x

    *)
  3. | SSLVERSION_SSLv2
    (*

    SSLv2

    *)
  4. | SSLVERSION_SSLv3
    (*

    SSLv3

    *)
  5. | SSLVERSION_TLSv1_0
    (*

    Added in libcurl 7.34.0, will request TLSv1.x in previous versions

    *)
  6. | SSLVERSION_TLSv1_1
    (*

    Added in libcurl 7.34.0, will request TLSv1.x in previous versions

    *)
  7. | SSLVERSION_TLSv1_2
    (*

    Added in libcurl 7.34.0, will request TLSv1.x in previous versions

    *)
  8. | SSLVERSION_TLSv1_3
    (*

    Added in libcurl 7.52.0, will request TLSv1.x in previous versions

    *)
Sourcetype curlTimeCondition =
  1. | TIMECOND_NONE
    (*

    since 0.6.1

    *)
  2. | TIMECOND_IFMODSINCE
  3. | TIMECOND_IFUNMODSINCE
  4. | TIMECOND_LASTMOD
    (*

    since 0.6.1

    *)
Sourcetype curlKRB4Level =
  1. | KRB4_NONE
  2. | KRB4_CLEAR
  3. | KRB4_SAFE
  4. | KRB4_CONFIDENTIAL
  5. | KRB4_PRIVATE
Sourcetype curlClosePolicy =
  1. | CLOSEPOLICY_OLDEST
  2. | CLOSEPOLICY_LEAST_RECENTLY_USED
Sourcetype curlSSLVerifyHost =
  1. | SSLVERIFYHOST_NONE
    (*

    connection succeeds regardless of the names in the certificate

    *)
  2. | SSLVERIFYHOST_EXISTENCE
    (*

    deprecated, equivalent to SSLVERIFYHOST_HOSTNAME

    *)
  3. | SSLVERIFYHOST_HOSTNAME
    (*

    certificate must indicate the matching hostname, or the connection fails

    *)
Sourcetype curlHTTPVersion =
  1. | HTTP_VERSION_NONE
    (*

    libcurl will make the best choice

    *)
  2. | HTTP_VERSION_1_0
    (*

    please use HTTP 1.0

    *)
  3. | HTTP_VERSION_1_1
    (*

    please use HTTP 1.1

    *)
  4. | HTTP_VERSION_2
    (*

    please use HTTP 2 (requires libcurl >= 7.33.0, otherwise will fallback to libcurl choice)

    *)
  5. | HTTP_VERSION_2TLS
    (*

    use version 2 for HTTPS, version 1.1 for HTTP (requires libcurl >= 7.47.0)

    *)
  6. | HTTP_VERSION_2_PRIOR_KNOWLEDGE
    (*

    Issue non-TLS HTTP requests using HTTP/2 without HTTP/1 (requires libcurl >= 7.49.0)

    *)
  7. | HTTP_VERSION_3
    (*

    Makes use of explicit HTTP/3 without fallback. Use CURLOPT_ALTSVC to enable HTTP/3 upgrade (requires libcurl >= 7.66.0)

    *)
Sourcetype curlDebugType =
  1. | DEBUGTYPE_TEXT
  2. | DEBUGTYPE_HEADER_IN
  3. | DEBUGTYPE_HEADER_OUT
  4. | DEBUGTYPE_DATA_IN
  5. | DEBUGTYPE_DATA_OUT
  6. | DEBUGTYPE_SSL_DATA_IN
  7. | DEBUGTYPE_SSL_DATA_OUT
  8. | DEBUGTYPE_END
Sourcetype curlAuth =
  1. | CURLAUTH_BASIC
  2. | CURLAUTH_DIGEST
  3. | CURLAUTH_GSSNEGOTIATE
  4. | CURLAUTH_NTLM
  5. | CURLAUTH_ANY
  6. | CURLAUTH_ANYSAFE
Sourcetype curlIPResolve =
  1. | IPRESOLVE_WHATEVER
  2. | IPRESOLVE_V4
  3. | IPRESOLVE_V6
Sourcetype curlFTPSSL =
  1. | FTPSSL_NONE
  2. | FTPSSL_TRY
  3. | FTPSSL_CONTROL
  4. | FTPSSL_ALL
Sourcetype curlFTPSSLAuth =
  1. | FTPAUTH_DEFAULT
  2. | FTPAUTH_SSL
  3. | FTPAUTH_TLS
Sourcetype curlIOCmd =
  1. | IOCMD_NOP
  2. | IOCMD_RESTARTREAD
Sourcetype curlIOErr =
  1. | IOE_OK
  2. | IOE_UNKNOWNCMD
  3. | IOE_FAILRESTART
Sourcetype curlSeekResult =
  1. | SEEKFUNC_OK
  2. | SEEKFUNC_FAIL
  3. | SEEKFUNC_CANTSEEK
Sourcetype curlFTPMethod =
  1. | FTPMETHOD_DEFAULT
  2. | FTPMETHOD_MULTICWD
  3. | FTPMETHOD_NOCWD
  4. | FTPMETHOD_SINGLECWD
Sourcetype curlSSHAuthTypes =
  1. | SSHAUTH_ANY
  2. | SSHAUTH_PUBLICKEY
  3. | SSHAUTH_PASSWORD
  4. | SSHAUTH_HOST
  5. | SSHAUTH_KEYBOARD
Sourcetype curlFTPSSLCCC =
  1. | FTPSSL_CCC_NONE
  2. | FTPSSL_CCC_PASSIVE
  3. | FTPSSL_CCC_ACTIVE
Sourcetype curlSeek =
  1. | SEEK_SET
  2. | SEEK_CUR
  3. | SEEK_END
Sourcetype curlProxyType =
  1. | CURLPROXY_HTTP
  2. | CURLPROXY_HTTP_1_0
    (*

    since libcurl 7.19.4

    *)
  3. | CURLPROXY_SOCKS4
    (*

    since libcurl 7.15.2

    *)
  4. | CURLPROXY_SOCKS5
  5. | CURLPROXY_SOCKS4A
    (*

    since libcurl 7.18.0

    *)
  6. | CURLPROXY_SOCKS5_HOSTNAME
    (*

    since libcurl 7.18.0

    *)
Sourcetype data_source =
  1. | String of string
    (*

    Equivalent to `CURLMIME_DATA`

    *)
  2. | File of string
    (*

    Equivalent to `CURLMIME_FILEDATA`

    *)
Sourcetype curlMIMEPartData =
  1. | CURLMIME_DATA of string
  2. | CURLMIME_FILEDATA of string
  3. | CURLMIME_DATA_WITH_NAME of {
    1. data : data_source;
    2. name : string option;
    3. filename : string option;
    }
Sourcetype curlMIMEEncoding =
  1. | CURLMIME_8BIT
  2. | CURLMIME_BINARY
  3. | CURLMIME_7BIT
  4. | CURLMIME_QUOTEDPRINTABLE
  5. | CURLMIME_BASE64
  6. | CURLMIME_NONE
Sourcetype curlMIMEPart = {
  1. encoding : curlMIMEEncoding;
  2. headers : string list;
  3. subparts : curlMIMEPart list;
  4. data : curlMIMEPartData;
}
Sourcetype curlKHMatch =
  1. | CURLKHMATCH_OK
  2. | CURLKHMATCH_MISMATCH of string
    (*

    Argument consists of the base64-encoded public key of the remote host as as found in the "known hosts" file *

    *)
  3. | CURLKHMATCH_MISSING
Sourcetype curlKHStat =
  1. | CURLKHSTAT_FINE_ADD_TO_FILE
  2. | CURLKHSTAT_FINE
  3. | CURLKHSTAT_REJECT
  4. | CURLKHSTAT_DEFER
Sourcetype curlProto =
  1. | CURLPROTO_ALL
    (*

    enable everything

    *)
  2. | CURLPROTO_HTTP
  3. | CURLPROTO_HTTPS
  4. | CURLPROTO_FTP
  5. | CURLPROTO_FTPS
  6. | CURLPROTO_SCP
  7. | CURLPROTO_SFTP
  8. | CURLPROTO_TELNET
  9. | CURLPROTO_LDAP
  10. | CURLPROTO_LDAPS
  11. | CURLPROTO_DICT
  12. | CURLPROTO_FILE
  13. | CURLPROTO_TFTP
  14. | CURLPROTO_IMAP
  15. | CURLPROTO_IMAPS
  16. | CURLPROTO_POP3
  17. | CURLPROTO_POP3S
  18. | CURLPROTO_SMTP
  19. | CURLPROTO_SMTPS
  20. | CURLPROTO_RTSP
  21. | CURLPROTO_RTMP
  22. | CURLPROTO_RTMPT
  23. | CURLPROTO_RTMPE
  24. | CURLPROTO_RTMPTE
  25. | CURLPROTO_RTMPS
  26. | CURLPROTO_RTMPTS
  27. | CURLPROTO_GOPHER

Protocols to enable (via CURLOPT_PROTOCOLS and CURLOPT_REDIR_PROTOCOLS)

Sourcetype curlPostRedir =
  1. | REDIR_POST_ALL
  2. | REDIR_POST_301
  3. | REDIR_POST_302
  4. | REDIR_POST_303
    (*

    added in libcurl 7.26.0

    *)

if flag is not supported by libcurl - enabling it does nothing

Sourcetype curlSslOption =
  1. | CURLSSLOPT_ALLOW_BEAST
  2. | CURLSSLOPT_NO_REVOKE
  3. | CURLSSLOPT_NO_PARTIALCHAIN
  4. | CURLSSLOPT_REVOKE_BEST_EFFORT
  5. | CURLSSLOPT_NATIVE_CA
  6. | CURLSSLOPT_AUTO_CLIENT_CERT
Sourcetype 'a xfer_result =
  1. | Proceed of 'a
  2. | Pause
  3. | Abort
Sourcetype write_result = unit xfer_result
Sourcetype read_result = string xfer_result
Sourceval proceed : write_result
Sourcetype curlOption =
  1. | CURLOPT_WRITEFUNCTION of string -> int
  2. | CURLOPT_READFUNCTION of int -> string
  3. | CURLOPT_INFILESIZE of int
  4. | CURLOPT_URL of string
  5. | CURLOPT_PROXY of string
  6. | CURLOPT_PROXYPORT of int
  7. | CURLOPT_HTTPPROXYTUNNEL of bool
  8. | CURLOPT_VERBOSE of bool
  9. | CURLOPT_HEADER of bool
  10. | CURLOPT_NOPROGRESS of bool
  11. | CURLOPT_NOSIGNAL of bool
  12. | CURLOPT_NOBODY of bool
  13. | CURLOPT_FAILONERROR of bool
  14. | CURLOPT_UPLOAD of bool
  15. | CURLOPT_POST of bool
  16. | CURLOPT_FTPLISTONLY of bool
  17. | CURLOPT_FTPAPPEND of bool
  18. | CURLOPT_NETRC of curlNETRCOption
  19. | CURLOPT_ENCODING of curlEncoding
  20. | CURLOPT_FOLLOWLOCATION of bool
  21. | CURLOPT_TRANSFERTEXT of bool
  22. | CURLOPT_PUT of bool
  23. | CURLOPT_USERPWD of string
  24. | CURLOPT_PROXYUSERPWD of string
  25. | CURLOPT_RANGE of string
  26. | CURLOPT_ERRORBUFFER of string ref
  27. | CURLOPT_TIMEOUT of int
  28. | CURLOPT_POSTFIELDS of string
  29. | CURLOPT_POSTFIELDSIZE of int
  30. | CURLOPT_REFERER of string
  31. | CURLOPT_USERAGENT of string
  32. | CURLOPT_FTPPORT of string
  33. | CURLOPT_LOWSPEEDLIMIT of int
  34. | CURLOPT_LOWSPEEDTIME of int
  35. | CURLOPT_RESUMEFROM of int
  36. | CURLOPT_HTTPHEADER of string list
  37. | CURLOPT_HTTPPOST of curlHTTPPost list
  38. | CURLOPT_SSLCERT of string
  39. | CURLOPT_SSLCERTTYPE of string
  40. | CURLOPT_SSLCERTPASSWD of string
  41. | CURLOPT_SSLKEY of string
  42. | CURLOPT_SSLKEYTYPE of string
  43. | CURLOPT_SSLKEYPASSWD of string
  44. | CURLOPT_SSLENGINE of string
  45. | CURLOPT_SSLENGINEDEFAULT of bool
  46. | CURLOPT_CRLF of bool
  47. | CURLOPT_QUOTE of string list
  48. | CURLOPT_POSTQUOTE of string list
  49. | CURLOPT_HEADERFUNCTION of string -> int
  50. | CURLOPT_COOKIEFILE of string
  51. | CURLOPT_SSLVERSION of curlSSLVersion
  52. | CURLOPT_TIMECONDITION of curlTimeCondition
  53. | CURLOPT_TIMEVALUE of int32
  54. | CURLOPT_CUSTOMREQUEST of string
  55. | CURLOPT_INTERFACE of string
  56. | CURLOPT_KRB4LEVEL of curlKRB4Level
  57. | CURLOPT_PROGRESSFUNCTION of float -> float -> float -> float -> bool
  58. | CURLOPT_SSLVERIFYPEER of bool
  59. | CURLOPT_CAINFO of string
  60. | CURLOPT_CAPATH of string
  61. | CURLOPT_FILETIME of bool
  62. | CURLOPT_MAXREDIRS of int
  63. | CURLOPT_MAXCONNECTS of int
  64. | CURLOPT_CLOSEPOLICY of curlClosePolicy
  65. | CURLOPT_FRESHCONNECT of bool
  66. | CURLOPT_FORBIDREUSE of bool
  67. | CURLOPT_RANDOMFILE of string
  68. | CURLOPT_EGDSOCKET of string
  69. | CURLOPT_CONNECTTIMEOUT of int
  70. | CURLOPT_HTTPGET of bool
  71. | CURLOPT_SSLVERIFYHOST of curlSSLVerifyHost
  72. | CURLOPT_COOKIEJAR of string
  73. | CURLOPT_SSLCIPHERLIST of string
  74. | CURLOPT_HTTPVERSION of curlHTTPVersion
  75. | CURLOPT_FTPUSEEPSV of bool
  76. | CURLOPT_DNSCACHETIMEOUT of int
  77. | CURLOPT_DNSUSEGLOBALCACHE of bool
  78. | CURLOPT_DEBUGFUNCTION of t -> curlDebugType -> string -> unit
  79. | CURLOPT_PRIVATE of string
    (*

    doesn't employ libcurl's CURLOPT_PRIVATE

    *)
  80. | CURLOPT_HTTP200ALIASES of string list
  81. | CURLOPT_UNRESTRICTEDAUTH of bool
  82. | CURLOPT_FTPUSEEPRT of bool
  83. | CURLOPT_HTTPAUTH of curlAuth list
  84. | CURLOPT_FTPCREATEMISSINGDIRS of bool
  85. | CURLOPT_PROXYAUTH of curlAuth list
  86. | CURLOPT_FTPRESPONSETIMEOUT of int
  87. | CURLOPT_IPRESOLVE of curlIPResolve
  88. | CURLOPT_MAXFILESIZE of int32
  89. | CURLOPT_INFILESIZELARGE of int64
  90. | CURLOPT_RESUMEFROMLARGE of int64
  91. | CURLOPT_MAXFILESIZELARGE of int64
  92. | CURLOPT_NETRCFILE of string
  93. | CURLOPT_FTPSSL of curlFTPSSL
  94. | CURLOPT_POSTFIELDSIZELARGE of int64
  95. | CURLOPT_TCPNODELAY of bool
  96. | CURLOPT_TCP_FASTOPEN of bool
  97. | CURLOPT_FTPSSLAUTH of curlFTPSSLAuth
  98. | CURLOPT_IOCTLFUNCTION of t -> curlIOCmd -> curlIOErr
  99. | CURLOPT_FTPACCOUNT of string
  100. | CURLOPT_COOKIELIST of string
  101. | CURLOPT_IGNORECONTENTLENGTH of bool
  102. | CURLOPT_FTPSKIPPASVIP of bool
  103. | CURLOPT_FTPFILEMETHOD of curlFTPMethod
  104. | CURLOPT_LOCALPORT of int
  105. | CURLOPT_LOCALPORTRANGE of int
  106. | CURLOPT_CONNECTONLY of bool
  107. | CURLOPT_MAXSENDSPEEDLARGE of int64
  108. | CURLOPT_MAXRECVSPEEDLARGE of int64
  109. | CURLOPT_FTPALTERNATIVETOUSER of string
  110. | CURLOPT_SSLSESSIONIDCACHE of bool
  111. | CURLOPT_SSHAUTHTYPES of curlSSHAuthTypes list
  112. | CURLOPT_SSHPUBLICKEYFILE of string
  113. | CURLOPT_SSHPRIVATEKEYFILE of string
  114. | CURLOPT_FTPSSLCCC of curlFTPSSLCCC
  115. | CURLOPT_TIMEOUTMS of int
  116. | CURLOPT_CONNECTTIMEOUTMS of int
  117. | CURLOPT_HTTPTRANSFERDECODING of bool
  118. | CURLOPT_HTTPCONTENTDECODING of bool
  119. | CURLOPT_NEWFILEPERMS of int
  120. | CURLOPT_NEWDIRECTORYPERMS of int
  121. | CURLOPT_POST301 of bool
  122. | CURLOPT_SSHHOSTPUBLICKEYMD5 of string
  123. | CURLOPT_COPYPOSTFIELDS of string
  124. | CURLOPT_PROXYTRANSFERMODE of bool
  125. | CURLOPT_SEEKFUNCTION of int64 -> curlSeek -> curlSeekResult
  126. | CURLOPT_AUTOREFERER of bool
  127. | CURLOPT_OPENSOCKETFUNCTION of Unix.file_descr -> unit
  128. | CURLOPT_PROXYTYPE of curlProxyType
  129. | CURLOPT_PROTOCOLS of curlProto list
  130. | CURLOPT_REDIR_PROTOCOLS of curlProto list
  131. | CURLOPT_RESOLVE of string list
  132. | CURLOPT_DNS_SERVERS of string
  133. | CURLOPT_MAIL_FROM of string
  134. | CURLOPT_MAIL_RCPT of string list
  135. | CURLOPT_PIPEWAIT of bool
  136. | CURLOPT_CERTINFO of bool
  137. | CURLOPT_USERNAME of string
  138. | CURLOPT_PASSWORD of string
  139. | CURLOPT_LOGIN_OPTIONS of string
  140. | CURLOPT_CONNECT_TO of string list
  141. | CURLOPT_POSTREDIR of curlPostRedir list
  142. | CURLOPT_MIMEPOST of curlMIMEPart list
  143. | CURLOPT_SSHKNOWNHOSTS of string
  144. | CURLOPT_SSHKEYFUNCTION of curlKHMatch -> string -> curlKHStat
    (*

    The second argument to the passed function consists of the raw bytes of the public key sent by the remote host. If the function raises an exception the key will be rejected, and the connection will fail.*

    *)
  145. | CURLOPT_BUFFERSIZE of int
  146. | CURLOPT_DOH_URL of string
  147. | CURLOPT_SSL_OPTIONS of curlSslOption list
  148. | CURLOPT_PROXY_SSL_OPTIONS of curlSslOption list
  149. | CURLOPT_WRITEFUNCTION2 of string -> write_result
  150. | CURLOPT_WRITEFUNCTION_BUF of bigstring -> write_result
  151. | CURLOPT_READFUNCTION2 of int -> read_result
  152. | CURLOPT_XFERINFOFUNCTION of int64 -> int64 -> int64 -> int64 -> bool
  153. | CURLOPT_PREREQFUNCTION of string -> string -> int -> int -> bool
  154. | CURLOPT_AWS_SIGV4 of string
  155. | CURLOPT_TCP_KEEPALIVE of bool
  156. | CURLOPT_TCP_KEEPIDLE of int
  157. | CURLOPT_TCP_KEEPINTVL of int
  158. | CURLOPT_NOPROXY of string
Sourcetype initOption =
  1. | CURLINIT_GLOBALALL
  2. | CURLINIT_GLOBALSSL
  3. | CURLINIT_GLOBALWIN32
  4. | CURLINIT_GLOBALNOTHING
Sourcetype curlInfo =
  1. | CURLINFO_EFFECTIVE_URL
  2. | CURLINFO_HTTP_CODE
  3. | CURLINFO_RESPONSE_CODE
  4. | CURLINFO_TOTAL_TIME
  5. | CURLINFO_NAMELOOKUP_TIME
  6. | CURLINFO_CONNECT_TIME
  7. | CURLINFO_PRETRANSFER_TIME
  8. | CURLINFO_SIZE_UPLOAD
  9. | CURLINFO_SIZE_DOWNLOAD
  10. | CURLINFO_SPEED_DOWNLOAD
  11. | CURLINFO_SPEED_UPLOAD
  12. | CURLINFO_HEADER_SIZE
  13. | CURLINFO_REQUEST_SIZE
  14. | CURLINFO_SSL_VERIFYRESULT
  15. | CURLINFO_FILETIME
  16. | CURLINFO_CONTENT_LENGTH_DOWNLOAD
  17. | CURLINFO_CONTENT_LENGTH_UPLOAD
  18. | CURLINFO_STARTTRANSFER_TIME
  19. | CURLINFO_CONTENT_TYPE
  20. | CURLINFO_REDIRECT_TIME
  21. | CURLINFO_REDIRECT_COUNT
  22. | CURLINFO_PRIVATE
    (*

    returns value previously set with CURLOPT_PRIVATE, doesn't employ libcurl's CURLINFO_PRIVATE

    *)
  23. | CURLINFO_HTTP_CONNECTCODE
  24. | CURLINFO_HTTPAUTH_AVAIL
  25. | CURLINFO_PROXYAUTH_AVAIL
  26. | CURLINFO_OS_ERRNO
  27. | CURLINFO_NUM_CONNECTS
  28. | CURLINFO_SSL_ENGINES
  29. | CURLINFO_COOKIELIST
  30. | CURLINFO_LASTSOCKET
  31. | CURLINFO_FTP_ENTRY_PATH
  32. | CURLINFO_REDIRECT_URL
  33. | CURLINFO_PRIMARY_IP
  34. | CURLINFO_LOCAL_IP
  35. | CURLINFO_LOCAL_PORT
  36. | CURLINFO_CONDITION_UNMET
  37. | CURLINFO_CERTINFO
  38. | CURLINFO_ACTIVESOCKET
  39. | CURLINFO_HTTP_VERSION
Sourcetype curlInfoResult =
  1. | CURLINFO_String of string
  2. | CURLINFO_Long of int
  3. | CURLINFO_Double of float
  4. | CURLINFO_StringList of string list
  5. | CURLINFO_StringListList of string list list
  6. | CURLINFO_Socket of Unix.file_descr
  7. | CURLINFO_Version of curlHTTPVersion
Sourcetype curlSslBackend =
  1. | CURLSSLBACKEND_NONE
  2. | CURLSSLBACKEND_OPENSSL
  3. | CURLSSLBACKEND_GNUTLS
  4. | CURLSSLBACKEND_NSS
  5. | CURLSSLBACKEND_GSKIT
  6. | CURLSSLBACKEND_WOLFSSL
  7. | CURLSSLBACKEND_SCHANNEL
  8. | CURLSSLBACKEND_SECURETRANSPORT
  9. | CURLSSLBACKEND_MBEDTLS
  10. | CURLSSLBACKEND_BEARSSL
Sourcetype curlSslSet =
  1. | CURLSSLSET_OK
  2. | CURLSSLSET_UNKNOWN_BACKEND
  3. | CURLSSLSET_TOO_LATE
  4. | CURLSSLSET_NO_BACKENDS
Sourcetype version_info = {
  1. version : string;
  2. number : int * int * int;
  3. host : string;
  4. features : string list;
  5. ssl_version : string option;
  6. libz_version : string option;
  7. protocols : string list;
  8. ares : string;
    (*

    starting from this field are optional features - may be empty/zero

    *)
  9. ares_num : int;
  10. libidn : string;
  11. iconv_ver_num : int;
  12. libssh_version : string;
}
Sourcetype pauseOption =
  1. | PAUSE_SEND
  2. | PAUSE_RECV
  3. | PAUSE_ALL
Sourcetype headerOrigin =
  1. | CURLH_HEADER
  2. | CURLH_TRAILER
  3. | CURLH_CONNECT
  4. | CURLH_1XX
  5. | CURLH_PSEUDO
Sourceval get_headers : t -> headerOrigin list -> request:int -> (string * string) list

Get a list of headers that result from repeatedly calling curl_easy_nextheader with the supplied origins and request. Typical usage is: get_headers [ CURLH_HEADER ] ~request:(-1)

  • since libcurl 7.83.0

MultiSSL mode

Sourceexception CurlSslSetException of curlSslSet
Sourceval global_sslset : curlSslBackend -> unit
  • since libcurl 7.56.0
Sourceval global_sslset_str : string -> unit
  • since libcurl 7.56.0
Sourceval global_sslsetavail : unit -> curlSslBackend list
  • since libcurl 7.56.0
Sourceval global_sslsetavail_str : unit -> string list
  • since libcurl 7.56.0

curl_easy API

Sourceval global_init : initOption -> unit
Sourceval global_cleanup : unit -> unit
Sourceval init : unit -> t
Sourceval reset : t -> unit

Reset t to the default state

Sourceval setopt : t -> curlOption -> unit
Sourceval perform : t -> unit
Sourceval cleanup : t -> unit
Sourceval getinfo : t -> curlInfo -> curlInfoResult
Sourceval escape : string -> string
Sourceval unescape : string -> string
Sourceval getdate : string -> float -> float
Sourceval version : unit -> string
Sourceval strerror : curlCode -> string
Sourceval int_of_curlCode : curlCode -> int
Sourceval curlCode_of_int : int -> curlCode option

same as int_of_curlCode

Sourceval errno : curlCode -> int
Sourceval version_info : unit -> version_info
Sourceval pause : t -> pauseOption list -> unit

flags set the new state, ie to unpause - pass empty list

Set transfer options

All callback functions shouldn't raise exceptions. Any exception raised in callback function will be silently caught and discarded, and the transfer will be aborted.

Sourceval set_writefunction : t -> (string -> int) -> unit
Sourceval set_writefunction2 : t -> (string -> write_result) -> unit
Sourceval set_writefunction_buf : t -> (bigstring -> write_result) -> unit

A write callback that provides direct access to curl's receive buffer. The provided buffer may only be read within the callback. It is illegal for the buffer to escape the scope of the callback.

This function provides better performance than string-based variants by avoiding an intermediate copy.

Sourceval set_readfunction : t -> (int -> string) -> unit

readfunction n should return string of length at most n, otherwise transfer will be aborted (as if with exception)

Sourceval set_readfunction2 : t -> (int -> read_result) -> unit
Sourceval set_infilesize : t -> int -> unit
Sourceval set_url : t -> string -> unit
Sourceval set_proxy : t -> string -> unit
Sourceval set_proxyport : t -> int -> unit
Sourceval set_httpproxytunnel : t -> bool -> unit
Sourceval set_verbose : t -> bool -> unit
Sourceval set_header : t -> bool -> unit
Sourceval set_noprogress : t -> bool -> unit
Sourceval set_nosignal : t -> bool -> unit
Sourceval set_nobody : t -> bool -> unit
Sourceval set_failonerror : t -> bool -> unit
Sourceval set_upload : t -> bool -> unit
Sourceval set_post : t -> bool -> unit
Sourceval set_ftplistonly : t -> bool -> unit
Sourceval set_ftpappend : t -> bool -> unit
Sourceval set_netrc : t -> curlNETRCOption -> unit
Sourceval set_encoding : t -> curlEncoding -> unit
Sourceval set_followlocation : t -> bool -> unit
Sourceval set_transfertext : t -> bool -> unit
Sourceval set_put : t -> bool -> unit
Sourceval set_userpwd : t -> string -> unit
Sourceval set_proxyuserpwd : t -> string -> unit
Sourceval set_range : t -> string -> unit
Sourceval set_errorbuffer : t -> string ref -> unit
Sourceval set_timeout : t -> int -> unit
Sourceval set_postfields : t -> string -> unit
Sourceval set_postfieldsize : t -> int -> unit
Sourceval set_referer : t -> string -> unit
Sourceval set_useragent : t -> string -> unit
Sourceval set_ftpport : t -> string -> unit
Sourceval set_lowspeedlimit : t -> int -> unit
Sourceval set_lowspeedtime : t -> int -> unit
Sourceval set_resumefrom : t -> int -> unit
Sourceval set_httpheader : t -> string list -> unit
Sourceval set_httppost : t -> curlHTTPPost list -> unit
Sourceval set_sslcert : t -> string -> unit
Sourceval set_sslcerttype : t -> string -> unit
Sourceval set_sslcertpasswd : t -> string -> unit
Sourceval set_sslkey : t -> string -> unit
Sourceval set_sslkeytype : t -> string -> unit
Sourceval set_sslkeypasswd : t -> string -> unit
Sourceval set_sslengine : t -> string -> unit
Sourceval set_sslenginedefault : t -> bool -> unit
Sourceval set_certinfo : t -> bool -> unit
Sourceval set_crlf : t -> bool -> unit
Sourceval set_quote : t -> string list -> unit
Sourceval set_postquote : t -> string list -> unit
Sourceval set_headerfunction : t -> (string -> int) -> unit
Sourceval set_cookiefile : t -> string -> unit
Sourceval set_sslversion : t -> curlSSLVersion -> unit
Sourceval set_timecondition : t -> curlTimeCondition -> unit
Sourceval set_timevalue : t -> int32 -> unit
Sourceval set_customrequest : t -> string -> unit
Sourceval set_interface : t -> string -> unit
Sourceval set_krb4level : t -> curlKRB4Level -> unit
Sourceval set_progressfunction : t -> (float -> float -> float -> float -> bool) -> unit

deprecated in favor of xferinfofunction since libcurl 7.32.0

Sourceval set_xferinfofunction : t -> (int64 -> int64 -> int64 -> int64 -> bool) -> unit

callback returns whether transfer should be interrupted, ie return false to continue transfering

Sourceval set_prereqfunction : t -> (string -> string -> int -> int -> bool) -> unit

callback returns whether transfer should be interrupted, ie return false to continue transfering

Sourceval set_sslverifypeer : t -> bool -> unit
Sourceval set_cainfo : t -> string -> unit
Sourceval set_capath : t -> string -> unit
Sourceval set_filetime : t -> bool -> unit
Sourceval set_maxredirs : t -> int -> unit
Sourceval set_maxconnects : t -> int -> unit
Sourceval set_closepolicy : t -> curlClosePolicy -> unit
Sourceval set_freshconnect : t -> bool -> unit
Sourceval set_forbidreuse : t -> bool -> unit
Sourceval set_randomfile : t -> string -> unit
Sourceval set_egdsocket : t -> string -> unit
Sourceval set_connecttimeout : t -> int -> unit
Sourceval set_httpget : t -> bool -> unit
Sourceval set_sslverifyhost : t -> curlSSLVerifyHost -> unit
Sourceval set_cookiejar : t -> string -> unit
Sourceval set_sslcipherlist : t -> string -> unit
Sourceval set_httpversion : t -> curlHTTPVersion -> unit
Sourceval set_ftpuseepsv : t -> bool -> unit
Sourceval set_dnscachetimeout : t -> int -> unit
Sourceval set_dnsuseglobalcache : t -> bool -> unit
Sourceval set_debugfunction : t -> (t -> curlDebugType -> string -> unit) -> unit
Sourceval set_private : t -> string -> unit
Sourceval set_http200aliases : t -> string list -> unit
Sourceval set_unrestrictedauth : t -> bool -> unit
Sourceval set_ftpuseeprt : t -> bool -> unit
Sourceval set_httpauth : t -> curlAuth list -> unit
Sourceval set_ftpcreatemissingdirs : t -> bool -> unit
Sourceval set_proxyauth : t -> curlAuth list -> unit
Sourceval set_ftpresponsetimeout : t -> int -> unit
Sourceval set_ipresolve : t -> curlIPResolve -> unit
Sourceval set_maxfilesize : t -> int32 -> unit
Sourceval set_infilesizelarge : t -> int64 -> unit
Sourceval set_resumefromlarge : t -> int64 -> unit
Sourceval set_maxfilesizelarge : t -> int64 -> unit
Sourceval set_netrcfile : t -> string -> unit
Sourceval set_ftpssl : t -> curlFTPSSL -> unit
Sourceval set_postfieldsizelarge : t -> int64 -> unit
Sourceval set_tcpnodelay : t -> bool -> unit
Sourceval set_tcpfastopen : t -> bool -> unit
Sourceval set_ftpsslauth : t -> curlFTPSSLAuth -> unit
Sourceval set_ioctlfunction : t -> (t -> curlIOCmd -> curlIOErr) -> unit
Sourceval set_ftpaccount : t -> string -> unit
Sourceval set_cookielist : t -> string -> unit
Sourceval set_ignorecontentlength : t -> bool -> unit
Sourceval set_ftpskippasvip : t -> bool -> unit
Sourceval set_ftpfilemethod : t -> curlFTPMethod -> unit
Sourceval set_localport : t -> int -> unit
Sourceval set_localportrange : t -> int -> unit
Sourceval set_connectonly : t -> bool -> unit
Sourceval set_maxsendspeedlarge : t -> int64 -> unit
Sourceval set_maxrecvspeedlarge : t -> int64 -> unit
Sourceval set_ftpalternativetouser : t -> string -> unit
Sourceval set_sslsessionidcache : t -> bool -> unit
Sourceval set_sshauthtypes : t -> curlSSHAuthTypes list -> unit
Sourceval set_sshpublickeyfile : t -> string -> unit
Sourceval set_sshprivatekeyfile : t -> string -> unit
Sourceval set_ftpsslccc : t -> curlFTPSSLCCC -> unit
Sourceval set_timeoutms : t -> int -> unit
Sourceval set_connecttimeoutms : t -> int -> unit
Sourceval set_httptransferdecoding : t -> bool -> unit
Sourceval set_httpcontentdecoding : t -> bool -> unit
Sourceval set_newfileperms : t -> int -> unit
Sourceval set_newdirectoryperms : t -> int -> unit
Sourceval set_post301 : t -> bool -> unit
Sourceval set_sshhostpublickeymd5 : t -> string -> unit
Sourceval set_copypostfields : t -> string -> unit
Sourceval set_proxytransfermode : t -> bool -> unit
Sourceval set_seekfunction : t -> (int64 -> curlSeek -> curlSeekResult) -> unit
Sourceval set_autoreferer : t -> bool -> unit
Sourceval set_opensocketfunction : t -> (Unix.file_descr -> unit) -> unit
Sourceval set_tcpkeepalive : t -> bool -> unit
Sourceval set_tcpkeepidle : t -> int -> unit
Sourceval set_tcpkeepintvl : t -> int -> unit
Sourceval set_proxytype : t -> curlProxyType -> unit
Sourceval set_protocols : t -> curlProto list -> unit
Sourceval set_redirprotocols : t -> curlProto list -> unit
Sourceval set_buffersize : t -> int -> unit
Sourceval set_doh_url : t -> string -> unit
Sourceval set_ssl_options : t -> curlSslOption list -> unit
Sourceval set_proxy_ssl_options : t -> curlSslOption list -> unit
Sourceval set_aws_sigv4 : t -> string -> unit
Sourceval set_resolve : t -> (string * int * string) list -> (string * int) list -> unit

set_resolve t add del adjusts builtin dns mapping

  • parameter add

    is the (host,port,address) list to add to dns mapping

  • parameter del

    is the (host,port) list to remove from mapping

Sourceval set_dns_servers : t -> string list -> unit
Sourceval set_mailfrom : t -> string -> unit
Sourceval set_mailrcpt : t -> string list -> unit
Sourceval set_pipewait : t -> bool -> unit
Sourceval set_username : t -> string -> unit
  • since 0.8.0
Sourceval set_password : t -> string -> unit
  • since 0.8.0
Sourceval set_login_options : t -> string -> unit
  • since 0.8.0
Sourceval set_connect_to : t -> string list -> unit
  • since 0.8.0
Sourceval set_postredir : t -> curlPostRedir list -> unit
  • since 0.8.1
Sourceval set_mimepost : t -> curlMIMEPart list -> unit
  • since 0.8.2
Sourceval set_sshknownhosts : t -> string -> unit
Sourceval set_sshkeyfunction : t -> (curlKHMatch -> string -> curlKHStat) -> unit
Sourceval set_noproxy : t -> string -> unit

Get transfer properties

Sourceval get_effectiveurl : t -> string
Sourceval get_redirecturl : t -> string
Sourceval get_httpcode : t -> int
Sourceval get_responsecode : t -> int
Sourceval get_totaltime : t -> float
Sourceval get_namelookuptime : t -> float
Sourceval get_connecttime : t -> float
Sourceval get_pretransfertime : t -> float
Sourceval get_sizeupload : t -> float
Sourceval get_sizedownload : t -> float
Sourceval get_speeddownload : t -> float
Sourceval get_speedupload : t -> float
Sourceval get_headersize : t -> int
Sourceval get_requestsize : t -> int
Sourceval get_sslverifyresult : t -> int
Sourceval get_filetime : t -> float
Sourceval get_contentlengthdownload : t -> float
Sourceval get_contentlengthupload : t -> float
Sourceval get_starttransfertime : t -> float
Sourceval get_contenttype : t -> string
Sourceval get_redirecttime : t -> float
Sourceval get_redirectcount : t -> int
Sourceval get_private : t -> string
Sourceval get_httpconnectcode : t -> int
Sourceval get_httpauthavail : t -> curlAuth list
Sourceval get_proxyauthavail : t -> curlAuth list
Sourceval get_oserrno : t -> int
Sourceval get_numconnects : t -> int
Sourceval get_sslengines : t -> string list
Sourceval get_cookielist : t -> string list
Sourceval get_lastsocket : t -> int
Sourceval get_activesocket : t -> Unix.file_descr option
Sourceval get_ftpentrypath : t -> string
Sourceval get_primaryip : t -> string
Sourceval get_localip : t -> string
  • since 0.5.5 (libcurl 7.21.0)
Sourceval get_localport : t -> int
  • since 0.5.5 (libcurl 7.21.0)
Sourceval get_conditionunmet : t -> bool
  • since 0.6.1 (libcurl 7.19.4)
Sourceval get_certinfo : t -> string list list
Sourceval get_http_version : t -> curlHTTPVersion
  • since 0.9.2

Object interface

Sourceclass handle : object ... end

curl_multi API

Sourcemodule Multi : sig ... end

Curl multi stack. Functions may raise Failure on critical errors