more version info fields
[ocurl.git] / curl.mli
blob6baabe02915f89edd8cf2cfa5dd06d354b9111aa
1 (*
2 * curl.mli
4 * Copyright (c) 2003-2008, Lars Nilsson, <lars@quantumchamaeleon.com>
5 * Copyright (c) 2009, ygrek, <ygrek@autistici.org>
6 *)
8 (** libcurl wrapper *)
10 type t
12 type curlCode =
13 | CURLE_OK
14 | CURLE_UNSUPPORTED_PROTOCOL
15 | CURLE_FAILED_INIT
16 | CURLE_URL_MALFORMAT
17 | CURLE_URL_MALFORMAT_USER
18 | CURLE_COULDNT_RESOLVE_PROXY
19 | CURLE_COULDNT_RESOLVE_HOST
20 | CURLE_COULDNT_CONNECT
21 | CURLE_FTP_WEIRD_SERVER_REPLY
22 | CURLE_FTP_ACCESS_DENIED
23 | CURLE_FTP_USER_PASSWORD_INCORRECT
24 | CURLE_FTP_WEIRD_PASS_REPLY
25 | CURLE_FTP_WEIRD_USER_REPLY
26 | CURLE_FTP_WEIRD_PASV_REPLY
27 | CURLE_FTP_WEIRD_227_FORMAT
28 | CURLE_FTP_CANT_GET_HOST
29 | CURLE_FTP_CANT_RECONNECT
30 | CURLE_FTP_COULDNT_SET_BINARY
31 | CURLE_PARTIAL_FILE
32 | CURLE_FTP_COULDNT_RETR_FILE
33 | CURLE_FTP_WRITE_ERROR
34 | CURLE_FTP_QUOTE_ERROR
35 | CURLE_HTTP_NOT_FOUND
36 | CURLE_WRITE_ERROR
37 | CURLE_MALFORMAT_USER
38 | CURLE_FTP_COULDNT_STOR_FILE
39 | CURLE_READ_ERROR
40 | CURLE_OUT_OF_MEMORY
41 | CURLE_OPERATION_TIMEOUTED
42 | CURLE_FTP_COULDNT_SET_ASCII
43 | CURLE_FTP_PORT_FAILED
44 | CURLE_FTP_COULDNT_USE_REST
45 | CURLE_FTP_COULDNT_GET_SIZE
46 | CURLE_HTTP_RANGE_ERROR
47 | CURLE_HTTP_POST_ERROR
48 | CURLE_SSL_CONNECT_ERROR
49 | CURLE_FTP_BAD_DOWNLOAD_RESUME
50 | CURLE_FILE_COULDNT_READ_FILE
51 | CURLE_LDAP_CANNOT_BIND
52 | CURLE_LDAP_SEARCH_FAILED
53 | CURLE_LIBRARY_NOT_FOUND
54 | CURLE_FUNCTION_NOT_FOUND
55 | CURLE_ABORTED_BY_CALLBACK
56 | CURLE_BAD_FUNCTION_ARGUMENT
57 | CURLE_BAD_CALLING_ORDER
58 | CURLE_HTTP_PORT_FAILED
59 | CURLE_BAD_PASSWORD_ENTERED
60 | CURLE_TOO_MANY_REDIRECTS
61 | CURLE_UNKNOWN_TELNET_OPTION
62 | CURLE_TELNET_OPTION_SYNTAX
63 | CURLE_OBSOLETE
64 | CURLE_SSL_PEER_CERTIFICATE
65 | CURLE_GOT_NOTHING
66 | CURLE_SSL_ENGINE_NOTFOUND
67 | CURLE_SSL_ENGINE_SETFAILED
68 | CURLE_SEND_ERROR
69 | CURLE_RECV_ERROR
70 | CURLE_SHARE_IN_USE
71 | CURLE_SSL_CERTPROBLEM
72 | CURLE_SSL_CIPHER
73 | CURLE_SSL_CACERT
74 | CURLE_BAD_CONTENT_ENCODING
75 | CURLE_LDAP_INVALID_URL
76 | CURLE_FILESIZE_EXCEEDED
77 | CURLE_USE_SSL_FAILED
78 | CURLE_SEND_FAIL_REWIND
79 | CURLE_SSL_ENGINE_INITFAILED
80 | CURLE_LOGIN_DENIED
81 | CURLE_TFTP_NOTFOUND
82 | CURLE_TFTP_PERM
83 | CURLE_REMOTE_DISK_FULL
84 | CURLE_TFTP_ILLEGAL
85 | CURLE_TFTP_UNKNOWNID
86 | CURLE_REMOTE_FILE_EXISTS
87 | CURLE_TFTP_NOSUCHUSER
88 | CURLE_CONV_FAILED
89 | CURLE_CONV_REQD
90 | CURLE_SSL_CACERT_BADFILE
91 | CURLE_REMOTE_FILE_NOT_FOUND
92 | CURLE_SSH
93 | CURLE_SSL_SHUTDOWN_FAILED
94 | CURLE_AGAIN
96 exception CurlException of (curlCode * int * string)
98 type curlNETRCOption =
99 | CURL_NETRC_OPTIONAL
100 | CURL_NETRC_IGNORED
101 | CURL_NETRC_REQUIRED
103 type curlEncoding =
104 | CURL_ENCODING_NONE (* identity *)
105 | CURL_ENCODING_DEFLATE (* deflate *)
106 | CURL_ENCODING_GZIP (* gzip *)
107 | CURL_ENCODING_ANY (* all supported encodings *)
109 type curlContentType =
110 | DEFAULT
111 | CONTENTTYPE of string
113 type curlHTTPPost =
114 | CURLFORM_CONTENT of string * string * curlContentType
115 | CURLFORM_FILECONTENT of string * string * curlContentType
116 | CURLFORM_FILE of string * string * curlContentType
117 | CURLFORM_BUFFER of string * string * string * curlContentType
120 type curlHTTPPost =
121 | CURLFORM_COPYNAME of string
122 | CURLFORM_PTRNAME of string
123 | CURLFORM_NAMELENGTH of int
124 | CURLFORM_COPYCONTENTS of string
125 | CURLFORM_PTRCONTENTS of string
126 | CURLFORM_FILE of string
127 | CURLFORM_FILECONTENT of string
128 | CURLFORM_CONTENTSLENGTH of int
129 | CURLFORM_CONTENTTYPE of string
132 type curlTimeCondition =
133 | TIMECOND_IFMODSINCE
134 | TIMECOND_IFUNMODSINCE
136 type curlKRB4Level =
137 | KRB4_NONE
138 | KRB4_CLEAR
139 | KRB4_SAFE
140 | KRB4_CONFIDENTIAL
141 | KRB4_PRIVATE
143 type curlClosePolicy =
144 | CLOSEPOLICY_OLDEST
145 | CLOSEPOLICY_LEAST_RECENTLY_USED
147 type curlSSLVerifyHost =
148 | SSLVERIFYHOST_NONE (** connection succeeds regardless of the names in the certificate *)
149 | SSLVERIFYHOST_EXISTENCE (** certificate must contain a Common Name field, but it doesn’t matter what name it says
150 (libcurl >= 7.28.0 will error out on this option, in such cases this library will pass
151 SSLVERIFYHOST_HOSTNAME to libcurl instead) *)
152 | SSLVERIFYHOST_HOSTNAME (** certificate must indicate the matching hostname, or the connection fails *)
154 type curlHTTPVersion =
155 | HTTP_VERSION_NONE
156 | HTTP_VERSION_1_0
157 | HTTP_VERSION_1_1
159 type curlDebugType =
160 | DEBUGTYPE_TEXT
161 | DEBUGTYPE_HEADER_IN
162 | DEBUGTYPE_HEADER_OUT
163 | DEBUGTYPE_DATA_IN
164 | DEBUGTYPE_DATA_OUT
165 | DEBUGTYPE_END
167 type curlAuth =
168 | CURLAUTH_BASIC
169 | CURLAUTH_DIGEST
170 | CURLAUTH_GSSNEGOTIATE
171 | CURLAUTH_NTLM
172 | CURLAUTH_ANY
173 | CURLAUTH_ANYSAFE
175 type curlIPResolve =
176 | IPRESOLVE_WHATEVER
177 | IPRESOLVE_V4
178 | IPRESOLVE_V6
180 type curlFTPSSL =
181 | FTPSSL_NONE
182 | FTPSSL_TRY
183 | FTPSSL_CONTROL
184 | FTPSSL_ALL
186 type curlFTPSSLAuth =
187 | FTPAUTH_DEFAULT
188 | FTPAUTH_SSL
189 | FTPAUTH_TLS
191 type curlIOCmd =
192 | IOCMD_NOP
193 | IOCMD_RESTARTREAD
195 type curlIOErr =
196 | IOE_OK
197 | IOE_UNKNOWNCMD
198 | IOE_FAILRESTART
200 type curlFTPMethod =
201 | FTPMETHOD_DEFAULT
202 | FTPMETHOD_MULTICWD
203 | FTPMETHOD_NOCWD
204 | FTPMETHOD_SINGLECWD
206 type curlSSHAuthTypes =
207 | SSHAUTH_ANY
208 | SSHAUTH_PUBLICKEY
209 | SSHAUTH_PASSWORD
210 | SSHAUTH_HOST
211 | SSHAUTH_KEYBOARD
213 type curlFTPSSLCCC =
214 | FTPSSL_CCC_NONE
215 | FTPSSL_CCC_PASSIVE
216 | FTPSSL_CCC_ACTIVE
218 type curlSeek =
219 | SEEK_SET
220 | SEEK_CUR
221 | SEEK_END
223 type curlProxyType =
224 | CURLPROXY_HTTP
225 | CURLPROXY_HTTP_1_0 (** added in 7.19.4 *)
226 | CURLPROXY_SOCKS4 (** added in 7.15.2 *)
227 | CURLPROXY_SOCKS5
228 | CURLPROXY_SOCKS4A (** added in 7.18.0 *)
229 | CURLPROXY_SOCKS5_HOSTNAME (** added in 7.18.0 *)
231 (** Protocols to enable (via CURLOPT_PROTOCOLS and CURLOPT_REDIR_PROTOCOLS) *)
232 type curlProto =
233 | CURLPROTO_ALL (** enable everything *)
234 | CURLPROTO_HTTP
235 | CURLPROTO_HTTPS
236 | CURLPROTO_FTP
237 | CURLPROTO_FTPS
238 | CURLPROTO_SCP
239 | CURLPROTO_SFTP
240 | CURLPROTO_TELNET
241 | CURLPROTO_LDAP
242 | CURLPROTO_LDAPS
243 | CURLPROTO_DICT
244 | CURLPROTO_FILE
245 | CURLPROTO_TFTP
246 | CURLPROTO_IMAP
247 | CURLPROTO_IMAPS
248 | CURLPROTO_POP3
249 | CURLPROTO_POP3S
250 | CURLPROTO_SMTP
251 | CURLPROTO_SMTPS
252 | CURLPROTO_RTSP
253 | CURLPROTO_RTMP
254 | CURLPROTO_RTMPT
255 | CURLPROTO_RTMPE
256 | CURLPROTO_RTMPTE
257 | CURLPROTO_RTMPS
258 | CURLPROTO_RTMPTS
259 | CURLPROTO_GOPHER
261 type curlOption =
262 | CURLOPT_WRITEFUNCTION of (string -> int)
263 | CURLOPT_READFUNCTION of (int -> string)
264 | CURLOPT_INFILESIZE of int
265 | CURLOPT_URL of string
266 | CURLOPT_PROXY of string
267 | CURLOPT_PROXYPORT of int
268 | CURLOPT_HTTPPROXYTUNNEL of bool
269 | CURLOPT_VERBOSE of bool
270 | CURLOPT_HEADER of bool
271 | CURLOPT_NOPROGRESS of bool
272 | CURLOPT_NOSIGNAL of bool
273 | CURLOPT_NOBODY of bool
274 | CURLOPT_FAILONERROR of bool
275 | CURLOPT_UPLOAD of bool
276 | CURLOPT_POST of bool
277 | CURLOPT_FTPLISTONLY of bool
278 | CURLOPT_FTPAPPEND of bool
279 | CURLOPT_NETRC of curlNETRCOption
280 | CURLOPT_ENCODING of curlEncoding
281 | CURLOPT_FOLLOWLOCATION of bool
282 | CURLOPT_TRANSFERTEXT of bool
283 | CURLOPT_PUT of bool
284 | CURLOPT_USERPWD of string
285 | CURLOPT_PROXYUSERPWD of string
286 | CURLOPT_RANGE of string
287 | CURLOPT_ERRORBUFFER of string ref
288 | CURLOPT_TIMEOUT of int
289 | CURLOPT_POSTFIELDS of string
290 | CURLOPT_POSTFIELDSIZE of int
291 | CURLOPT_REFERER of string
292 | CURLOPT_USERAGENT of string
293 | CURLOPT_FTPPORT of string
294 | CURLOPT_LOWSPEEDLIMIT of int
295 | CURLOPT_LOWSPEEDTIME of int
296 | CURLOPT_RESUMEFROM of int
297 | CURLOPT_COOKIE of string
298 | CURLOPT_HTTPHEADER of string list
299 | CURLOPT_HTTPPOST of curlHTTPPost list
300 | CURLOPT_SSLCERT of string
301 | CURLOPT_SSLCERTTYPE of string
302 | CURLOPT_SSLCERTPASSWD of string
303 | CURLOPT_SSLKEY of string
304 | CURLOPT_SSLKEYTYPE of string
305 | CURLOPT_SSLKEYPASSWD of string
306 | CURLOPT_SSLENGINE of string
307 | CURLOPT_SSLENGINEDEFAULT of bool
308 | CURLOPT_CRLF of bool
309 | CURLOPT_QUOTE of string list
310 | CURLOPT_POSTQUOTE of string list
311 | CURLOPT_HEADERFUNCTION of (string -> int)
312 | CURLOPT_COOKIEFILE of string
313 | CURLOPT_SSLVERSION of int
314 | CURLOPT_TIMECONDITION of curlTimeCondition
315 | CURLOPT_TIMEVALUE of int32
316 | CURLOPT_CUSTOMREQUEST of string
317 | CURLOPT_STDERR (* UNIMPLEMENTED *)
318 | CURLOPT_INTERFACE of string
319 | CURLOPT_KRB4LEVEL of curlKRB4Level
320 | CURLOPT_PROGRESSFUNCTION of (float -> float -> float -> float -> bool)
321 | CURLOPT_SSLVERIFYPEER of bool
322 | CURLOPT_CAINFO of string
323 | CURLOPT_CAPATH of string
324 | CURLOPT_FILETIME of bool
325 | CURLOPT_MAXREDIRS of int
326 | CURLOPT_MAXCONNECTS of int
327 | CURLOPT_CLOSEPOLICY of curlClosePolicy
328 | CURLOPT_FRESHCONNECT of bool
329 | CURLOPT_FORBIDREUSE of bool
330 | CURLOPT_RANDOMFILE of string
331 | CURLOPT_EGDSOCKET of string
332 | CURLOPT_CONNECTTIMEOUT of int
333 | CURLOPT_HTTPGET of bool
334 | CURLOPT_SSLVERIFYHOST of curlSSLVerifyHost
335 | CURLOPT_COOKIEJAR of string
336 | CURLOPT_SSLCIPHERLIST of string
337 | CURLOPT_HTTPVERSION of curlHTTPVersion
338 | CURLOPT_FTPUSEEPSV of bool
339 | CURLOPT_DNSCACHETIMEOUT of int
340 | CURLOPT_DNSUSEGLOBALCACHE of bool
341 | CURLOPT_DEBUGFUNCTION of (t -> curlDebugType -> string -> unit)
342 | CURLOPT_PRIVATE of string
343 | CURLOPT_HTTP200ALIASES of string list
344 | CURLOPT_UNRESTRICTEDAUTH of bool
345 | CURLOPT_FTPUSEEPRT of bool
346 | CURLOPT_HTTPAUTH of curlAuth list
347 | CURLOPT_FTPCREATEMISSINGDIRS of bool
348 | CURLOPT_PROXYAUTH of curlAuth list
349 | CURLOPT_FTPRESPONSETIMEOUT of int
350 | CURLOPT_IPRESOLVE of curlIPResolve
351 | CURLOPT_MAXFILESIZE of int32
352 | CURLOPT_INFILESIZELARGE of int64
353 | CURLOPT_RESUMEFROMLARGE of int64
354 | CURLOPT_MAXFILESIZELARGE of int64
355 | CURLOPT_NETRCFILE of string
356 | CURLOPT_FTPSSL of curlFTPSSL
357 | CURLOPT_POSTFIELDSIZELARGE of int64
358 | CURLOPT_TCPNODELAY of bool
359 | CURLOPT_FTPSSLAUTH of curlFTPSSLAuth
360 | CURLOPT_IOCTLFUNCTION of (t -> curlIOCmd -> curlIOErr)
361 | CURLOPT_FTPACCOUNT of string
362 | CURLOPT_COOKIELIST of string
363 | CURLOPT_IGNORECONTENTLENGTH of bool
364 | CURLOPT_FTPSKIPPASVIP of bool
365 | CURLOPT_FTPFILEMETHOD of curlFTPMethod
366 | CURLOPT_LOCALPORT of int
367 | CURLOPT_LOCALPORTRANGE of int
368 | CURLOPT_CONNECTONLY of bool
369 | CURLOPT_MAXSENDSPEEDLARGE of int64
370 | CURLOPT_MAXRECVSPEEDLARGE of int64
371 | CURLOPT_FTPALTERNATIVETOUSER of string
372 | CURLOPT_SSLSESSIONIDCACHE of bool
373 | CURLOPT_SSHAUTHTYPES of curlSSHAuthTypes list
374 | CURLOPT_SSHPUBLICKEYFILE of string
375 | CURLOPT_SSHPRIVATEKEYFILE of string
376 | CURLOPT_FTPSSLCCC of curlFTPSSLCCC
377 | CURLOPT_TIMEOUTMS of int
378 | CURLOPT_CONNECTTIMEOUTMS of int
379 | CURLOPT_HTTPTRANSFERDECODING of bool
380 | CURLOPT_HTTPCONTENTDECODING of bool
381 | CURLOPT_NEWFILEPERMS of int
382 | CURLOPT_NEWDIRECTORYPERMS of int
383 | CURLOPT_POST301 of bool
384 | CURLOPT_SSHHOSTPUBLICKEYMD5 of string
385 | CURLOPT_COPYPOSTFIELDS of string
386 | CURLOPT_PROXYTRANSFERMODE of bool
387 | CURLOPT_SEEKFUNCTION of (int64 -> curlSeek -> int)
388 | CURLOPT_AUTOREFERER of bool
389 | CURLOPT_OPENSOCKETFUNCTION of (Unix.file_descr -> unit)
390 | CURLOPT_PROXYTYPE of curlProxyType
391 | CURLOPT_PROTOCOLS of curlProto list
392 | CURLOPT_REDIR_PROTOCOLS of curlProto list
393 | CURLOPT_RESOLVE of string list
394 | CURLOPT_DNS_SERVERS of string
396 type initOption =
397 | CURLINIT_GLOBALALL
398 | CURLINIT_GLOBALSSL
399 | CURLINIT_GLOBALWIN32
400 | CURLINIT_GLOBALNOTHING
402 type curlInfo =
403 | CURLINFO_EFFECTIVE_URL
404 | CURLINFO_HTTP_CODE
405 | CURLINFO_RESPONSE_CODE
406 | CURLINFO_TOTAL_TIME
407 | CURLINFO_NAMELOOKUP_TIME
408 | CURLINFO_CONNECT_TIME
409 | CURLINFO_PRETRANSFER_TIME
410 | CURLINFO_SIZE_UPLOAD
411 | CURLINFO_SIZE_DOWNLOAD
412 | CURLINFO_SPEED_DOWNLOAD
413 | CURLINFO_SPEED_UPLOAD
414 | CURLINFO_HEADER_SIZE
415 | CURLINFO_REQUEST_SIZE
416 | CURLINFO_SSL_VERIFYRESULT
417 | CURLINFO_FILETIME
418 | CURLINFO_CONTENT_LENGTH_DOWNLOAD
419 | CURLINFO_CONTENT_LENGTH_UPLOAD
420 | CURLINFO_STARTTRANSFER_TIME
421 | CURLINFO_CONTENT_TYPE
422 | CURLINFO_REDIRECT_TIME
423 | CURLINFO_REDIRECT_COUNT
424 | CURLINFO_PRIVATE
425 | CURLINFO_HTTP_CONNECTCODE
426 | CURLINFO_HTTPAUTH_AVAIL
427 | CURLINFO_PROXYAUTH_AVAIL
428 | CURLINFO_OS_ERRNO
429 | CURLINFO_NUM_CONNECTS
430 | CURLINFO_SSL_ENGINES
431 | CURLINFO_COOKIELIST
432 | CURLINFO_LASTSOCKET
433 | CURLINFO_FTP_ENTRY_PATH
434 | CURLINFO_REDIRECT_URL
435 | CURLINFO_PRIMARY_IP
437 type curlInfoResult =
438 | CURLINFO_String of string
439 | CURLINFO_Long of int
440 | CURLINFO_Double of float
441 | CURLINFO_StringList of string list
443 type version_info = {
444 version : string;
445 number : int * int * int;
446 host : string;
447 features : int;
448 ssl_version : string option;
449 libz_version : string option;
450 protocols : string list;
451 ares : string; (** starting from this field are optional features - may be empty/zero *)
452 ares_num : int;
453 libidn : string;
454 iconv_ver_num : int;
455 libssh_version : string;
458 val global_init : initOption -> unit
459 val global_cleanup : unit -> unit
460 val init : unit -> t
461 (** Reset [t] to the default state *)
462 val reset : t -> unit
463 val duphandle : t -> t
464 val setopt : t -> curlOption -> unit
465 val perform : t -> unit
466 val cleanup : t -> unit
467 val getinfo : t -> curlInfo -> curlInfoResult
468 val escape : string -> string
469 val unescape : string -> string
470 val getdate : string -> float -> float
471 val version : unit -> string
472 val strerror : curlCode -> string
473 val errno : curlCode -> int
474 val version_info : unit -> version_info
476 val set_writefunction : t -> (string -> int) -> unit
477 val set_readfunction : t -> (int -> string) -> unit
478 val set_infilesize : t -> int -> unit
479 val set_url : t -> string -> unit
480 val set_proxy : t -> string -> unit
481 val set_proxyport : t -> int -> unit
482 val set_httpproxytunnel : t -> bool -> unit
483 val set_verbose : t -> bool -> unit
484 val set_header : t -> bool -> unit
485 val set_noprogress : t -> bool -> unit
486 val set_nosignal : t -> bool -> unit
487 val set_nobody : t -> bool -> unit
488 val set_failonerror : t -> bool -> unit
489 val set_upload : t -> bool -> unit
490 val set_post : t -> bool -> unit
491 val set_ftplistonly : t -> bool -> unit
492 val set_ftpappend : t -> bool -> unit
493 val set_netrc : t -> curlNETRCOption -> unit
494 val set_encoding : t -> curlEncoding -> unit
495 val set_followlocation : t -> bool -> unit
496 val set_transfertext : t -> bool -> unit
497 val set_put : t -> bool -> unit
498 val set_userpwd : t -> string -> unit
499 val set_proxyuserpwd : t -> string -> unit
500 val set_range : t -> string -> unit
501 val set_errorbuffer : t -> string ref -> unit
502 val set_timeout : t -> int -> unit
503 val set_postfields : t -> string -> unit
504 val set_postfieldsize : t -> int -> unit
505 val set_referer : t -> string -> unit
506 val set_useragent : t -> string -> unit
507 val set_ftpport : t -> string -> unit
508 val set_lowspeedlimit : t -> int -> unit
509 val set_lowspeedtime : t -> int -> unit
510 val set_resumefrom : t -> int -> unit
511 val set_cookie : t -> string -> unit
512 val set_httpheader : t -> string list -> unit
513 val set_httppost : t -> curlHTTPPost list -> unit
514 val set_sslcert : t -> string -> unit
515 val set_sslcerttype : t -> string -> unit
516 val set_sslcertpasswd : t -> string -> unit
517 val set_sslkey : t -> string -> unit
518 val set_sslkeytype : t -> string -> unit
519 val set_sslkeypasswd : t -> string -> unit
520 val set_sslengine : t -> string -> unit
521 val set_sslenginedefault : t -> bool -> unit
522 val set_crlf : t -> bool -> unit
523 val set_quote : t -> string list -> unit
524 val set_postquote : t -> string list -> unit
525 val set_headerfunction: t -> (string -> int) -> unit
526 val set_cookiefile : t -> string -> unit
527 val set_sslversion : t -> int -> unit
528 val set_timecondition : t -> curlTimeCondition -> unit
529 val set_timevalue : t -> int32 -> unit
530 val set_customrequest : t -> string -> unit
531 val set_interface : t -> string -> unit
532 val set_krb4level : t -> curlKRB4Level -> unit
533 val set_progressfunction : t -> (float -> float -> float -> float -> bool) -> unit
534 val set_sslverifypeer : t -> bool -> unit
535 val set_cainfo : t -> string -> unit
536 val set_capath : t -> string -> unit
537 val set_filetime : t -> bool -> unit
538 val set_maxredirs : t -> int -> unit
539 val set_maxconnects : t -> int -> unit
540 val set_closepolicy : t -> curlClosePolicy -> unit
541 val set_freshconnect : t -> bool -> unit
542 val set_forbidreuse : t -> bool -> unit
543 val set_randomfile : t -> string -> unit
544 val set_egdsocket : t -> string -> unit
545 val set_connecttimeout : t -> int -> unit
546 val set_httpget : t -> bool -> unit
547 val set_sslverifyhost : t -> curlSSLVerifyHost -> unit
548 val set_cookiejar : t -> string -> unit
549 val set_sslcipherlist : t -> string -> unit
550 val set_httpversion : t -> curlHTTPVersion -> unit
551 val set_ftpuseepsv : t -> bool -> unit
552 val set_dnscachetimeout : t -> int -> unit
553 val set_dnsuseglobalcache : t -> bool -> unit
554 val set_debugfunction : t -> (t -> curlDebugType -> string -> unit) -> unit
555 val set_private : t -> string -> unit
556 val set_http200aliases : t -> string list -> unit
557 val set_unrestrictedauth : t -> bool -> unit
558 val set_ftpuseeprt : t -> bool -> unit
559 val set_httpauth : t -> curlAuth list -> unit
560 val set_ftpcreatemissingdirs : t -> bool -> unit
561 val set_proxyauth : t -> curlAuth list -> unit
562 val set_ftpresponsetimeout : t -> int -> unit
563 val set_ipresolve : t -> curlIPResolve -> unit
564 val set_maxfilesize : t -> int32 -> unit
565 val set_infilesizelarge : t -> int64 -> unit
566 val set_resumefromlarge : t -> int64 -> unit
567 val set_maxfilesizelarge : t -> int64 -> unit
568 val set_netrcfile : t -> string -> unit
569 val set_ftpssl : t -> curlFTPSSL -> unit
570 val set_postfieldsizelarge : t -> int64 -> unit
571 val set_tcpnodelay : t -> bool -> unit
572 val set_ftpsslauth : t -> curlFTPSSLAuth -> unit
573 val set_ioctlfunction : t -> (t -> curlIOCmd -> curlIOErr) -> unit
574 val set_ftpaccount : t -> string -> unit
575 val set_cookielist : t -> string -> unit
576 val set_ignorecontentlength : t -> bool -> unit
577 val set_ftpskippasvip : t -> bool -> unit
578 val set_ftpfilemethod : t -> curlFTPMethod -> unit
579 val set_localport : t -> int -> unit
580 val set_localportrange : t -> int -> unit
581 val set_connectonly : t -> bool -> unit
582 val set_maxsendspeedlarge : t -> int64 -> unit
583 val set_maxrecvspeedlarge : t -> int64 -> unit
584 val set_ftpalternativetouser : t -> string -> unit
585 val set_sslsessionidcache : t -> bool -> unit
586 val set_sshauthtypes : t -> curlSSHAuthTypes list -> unit
587 val set_sshpublickeyfile : t -> string -> unit
588 val set_ftpsslccc : t -> curlFTPSSLCCC -> unit
589 val set_timeoutms : t -> int -> unit
590 val set_connecttimeoutms : t -> int -> unit
591 val set_httptransferdecoding : t -> bool -> unit
592 val set_httpcontentdecoding : t -> bool -> unit
593 val set_newfileperms : t -> int -> unit
594 val set_newdirectoryperms : t -> int -> unit
595 val set_post301 : t -> bool -> unit
596 val set_sshhostpublickeymd5 : t -> string -> unit
597 val set_copypostfields : t -> string -> unit
598 val set_proxytransfermode : t -> bool -> unit
599 val set_seekfunction : t -> (int64 -> curlSeek -> int) -> unit
600 val set_autoreferer : t -> bool -> unit
601 val set_opensocketfunction : t -> (Unix.file_descr -> unit) -> unit
602 val set_proxytype : t -> curlProxyType -> unit
603 val set_protocols : t -> curlProto list -> unit
604 val set_redirprotocols : t -> curlProto list -> unit
606 (** [set_resolve t add del] adjusts builtin dns mapping
608 @param add is the (host,port,address) list to add to dns mapping
609 @param del is the (host,port) list to remove from mapping
611 val set_resolve : t -> (string * int * string) list -> (string * int) list -> unit
612 val set_dns_servers : t -> string list -> unit
614 val get_effectiveurl : t -> string
615 val get_redirecturl : t -> string
616 val get_httpcode : t -> int
617 val get_responsecode : t -> int
618 val get_totaltime : t -> float
619 val get_namelookuptime : t -> float
620 val get_connecttime : t -> float
621 val get_pretransfertime : t -> float
622 val get_sizeupload : t -> float
623 val get_sizedownload : t -> float
624 val get_speeddownload : t -> float
625 val get_speedupload : t -> float
626 val get_headersize : t -> int
627 val get_requestsize : t -> int
628 val get_sslverifyresult : t -> int
629 val get_filetime : t -> float
630 val get_contentlengthdownload : t -> float
631 val get_contentlengthupload : t -> float
632 val get_starttransfertime : t -> float
633 val get_contenttype : t -> string
634 val get_redirecttime : t -> float
635 val get_redirectcount : t -> int
636 val get_private : t -> string
637 val get_httpconnectcode : t -> int
638 val get_httpauthavail : t -> curlAuth list
639 val get_proxyauthavail : t -> curlAuth list
640 val get_oserrno : t -> int
641 val get_numconnects : t -> int
642 val get_sslengines : t -> string list
643 val get_cookielist : t -> string list
644 val get_lastsocket : t -> int
645 val get_ftpentrypath : t -> string
646 val get_primaryip : t -> string
648 class handle :
649 object ('a)
650 val conn : t
651 method cleanup : unit
652 method duphandle : 'a
653 method perform : unit
655 method set_writefunction : (string -> int) -> unit
656 method set_readfunction : (int -> string) -> unit
657 method set_infilesize : int -> unit
658 method set_url : string -> unit
659 method set_proxy : string -> unit
660 method set_proxyport : int -> unit
661 method set_httpproxytunnel : bool -> unit
662 method set_verbose : bool -> unit
663 method set_header : bool -> unit
664 method set_noprogress : bool -> unit
665 method set_nosignal : bool -> unit
666 method set_nobody : bool -> unit
667 method set_failonerror : bool -> unit
668 method set_upload : bool -> unit
669 method set_post : bool -> unit
670 method set_ftplistonly : bool -> unit
671 method set_ftpappend : bool -> unit
672 method set_netrc : curlNETRCOption -> unit
673 method set_encoding : curlEncoding -> unit
674 method set_followlocation : bool -> unit
675 method set_transfertext : bool -> unit
676 method set_put : bool -> unit
677 method set_userpwd : string -> unit
678 method set_proxyuserpwd : string -> unit
679 method set_range : string -> unit
680 method set_errorbuffer : string ref -> unit
681 method set_timeout : int -> unit
682 method set_postfields : string -> unit
683 method set_postfieldsize : int -> unit
684 method set_referer : string -> unit
685 method set_useragent : string -> unit
686 method set_ftpport : string -> unit
687 method set_lowspeedlimit : int -> unit
688 method set_lowspeedtime : int -> unit
689 method set_resumefrom : int -> unit
690 method set_cookie : string -> unit
691 method set_httpheader : string list -> unit
692 method set_httppost : curlHTTPPost list -> unit
693 method set_sslcert : string -> unit
694 method set_sslcerttype : string -> unit
695 method set_sslcertpasswd : string -> unit
696 method set_sslkey : string -> unit
697 method set_sslkeytype : string -> unit
698 method set_sslkeypasswd : string -> unit
699 method set_sslengine : string -> unit
700 method set_sslenginedefault : bool -> unit
701 method set_crlf : bool -> unit
702 method set_quote : string list -> unit
703 method set_postquote : string list -> unit
704 method set_headerfunction: (string -> int) -> unit
705 method set_cookiefile : string -> unit
706 method set_sslversion : int -> unit
707 method set_timecondition : curlTimeCondition -> unit
708 method set_timevalue : int32 -> unit
709 method set_customrequest : string -> unit
710 method set_interface : string -> unit
711 method set_krb4level : curlKRB4Level -> unit
712 method set_progressfunction :
713 (float -> float -> float -> float -> bool) -> unit
714 method set_sslverifypeer : bool -> unit
715 method set_cainfo : string -> unit
716 method set_capath : string -> unit
717 method set_filetime : bool -> unit
718 method set_maxredirs : int -> unit
719 method set_maxconnects : int -> unit
720 method set_closepolicy : curlClosePolicy -> unit
721 method set_freshconnect : bool -> unit
722 method set_forbidreuse : bool -> unit
723 method set_randomfile : string -> unit
724 method set_egdsocket : string -> unit
725 method set_connecttimeout : int -> unit
726 method set_httpget : bool -> unit
727 method set_sslverifyhost : curlSSLVerifyHost -> unit
728 method set_cookiejar : string -> unit
729 method set_sslcipherlist : string -> unit
730 method set_httpversion : curlHTTPVersion -> unit
731 method set_ftpuseepsv : bool -> unit
732 method set_dnscachetimeout : int -> unit
733 method set_dnsuseglobalcache : bool -> unit
734 method set_debugfunction : (t -> curlDebugType -> string -> unit) -> unit
735 method set_private : string -> unit
736 method set_http200aliases : string list -> unit
737 method set_unrestrictedauth : bool -> unit
738 method set_ftpuseeprt : bool -> unit
739 method set_httpauth : curlAuth list -> unit
740 method set_ftpcreatemissingdirs : bool -> unit
741 method set_proxyauth : curlAuth list -> unit
742 method set_ftpresponsetimeout : int -> unit
743 method set_ipresolve : curlIPResolve -> unit
744 method set_maxfilesize : int32 -> unit
745 method set_infilesizelarge : int64 -> unit
746 method set_resumefromlarge : int64 -> unit
747 method set_maxfilesizelarge : int64 -> unit
748 method set_netrcfile : string -> unit
749 method set_ftpssl : curlFTPSSL -> unit
750 method set_postfieldsizelarge : int64 -> unit
751 method set_tcpnodelay : bool -> unit
752 method set_ftpsslauth : curlFTPSSLAuth -> unit
753 method set_ioctlfunction : (t -> curlIOCmd -> curlIOErr) -> unit
754 method set_ftpaccount : string -> unit
755 method set_cookielist : string -> unit
756 method set_ignorecontentlength : bool -> unit
757 method set_ftpskippasvip : bool -> unit
758 method set_ftpfilemethod : curlFTPMethod -> unit
759 method set_localport : int -> unit
760 method set_localportrange : int -> unit
761 method set_connectonly : bool -> unit
762 method set_maxsendspeedlarge : int64 -> unit
763 method set_maxrecvspeedlarge : int64 -> unit
764 method set_ftpalternativetouser : string -> unit
765 method set_sslsessionidcache : bool -> unit
766 method set_sshauthtypes : curlSSHAuthTypes list -> unit
767 method set_sshpublickeyfile : string -> unit
768 method set_sshprivatekeyfile : string -> unit
769 method set_ftpsslccc : curlFTPSSLCCC -> unit
770 method set_timeoutms : int -> unit
771 method set_connecttimeoutms : int -> unit
772 method set_httptransferdecoding : bool -> unit
773 method set_httpcontentdecoding : bool -> unit
774 method set_newfileperms : int -> unit
775 method set_newdirectoryperms : int -> unit
776 method set_post301 : bool -> unit
777 method set_sshhostpublickeymd5 : string -> unit
778 method set_copypostfields : string -> unit
779 method set_proxytransfermode : bool -> unit
780 method set_seekfunction : (int64 -> curlSeek -> int) -> unit
781 method set_autoreferer : bool -> unit
782 method set_opensocketfunction : (Unix.file_descr -> unit) -> unit
783 method set_proxytype : curlProxyType -> unit
784 method set_resolve : (string * int * string) list -> (string * int) list -> unit
785 method set_dns_servers : string list -> unit
787 method get_effectiveurl : string
788 method get_httpcode : int
789 method get_responsecode : int
790 method get_totaltime : float
791 method get_namelookuptime : float
792 method get_connecttime : float
793 method get_pretransfertime : float
794 method get_sizeupload : float
795 method get_sizedownload : float
796 method get_speeddownload : float
797 method get_speedupload : float
798 method get_headersize : int
799 method get_requestsize : int
800 method get_sslverifyresult : int
801 method get_filetime : float
802 method get_contentlengthdownload : float
803 method get_contentlengthupload : float
804 method get_starttransfertime : float
805 method get_contenttype : string
806 method get_redirecttime : float
807 method get_redirectcount : int
808 method get_private : string
809 method get_httpconnectcode : int
810 method get_httpauthavail : curlAuth list
811 method get_proxyauthavail : curlAuth list
812 method get_oserrno : int
813 method get_numconnects : int
814 method get_sslengines : string list
815 method get_cookielist : string list
816 method get_lastsocket : int
817 method get_ftpentrypath : string
818 method get_primaryip : string
821 (** Curl multi stack. Functions may raise [Failure] on critical errors *)
822 module Multi : sig
824 (** type of Curl multi stack *)
825 type mt
827 (** create new multi stack *)
828 val create : unit -> mt
830 (** add handle to multi stack *)
831 val add : mt -> t -> unit
833 (** perform pending data transfers (if any) on all handles currently in multi stack
834 @return the number of handles that still transfer data *)
835 val perform : mt -> int
837 (** wait till there are some active data transfers on multi stack
838 @return whether [perform] should be called *)
839 val wait : mt -> bool
841 (** remove finished handle from the multi stack if any. The handle can be reused *)
842 val remove_finished : mt -> (t * curlCode) option
844 (** destroy multi handle (all transfers are stopped, but individual handles are left alive) *)
845 val cleanup : mt -> unit