Skip to content

miyako/4d-plugin-curl-v3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

version platform license downloads

4d-plugin-curl-v3

Generic network client based on libcurl.

  • macOS library version:

    • libcurl-8.9.1
    • openssl-3.3.1
    • libz-1.2.11
    • libssh2-1.11.0
    • brotli-1.0.9
    • nghttp2-1.61.0
    • zstd-1.5.6
  • Windows library version:

    • libcurl-8.9.1
    • openssl-3.3.1 (Schannel)
    • libz-1.3.1
    • libssh2-1.11.0
    • brotli-1.1.0
    • nghttp2-1.62.1
    • zstd-1.5.5

vcpkg configuration: [brotli,c-ares,core,http2,idn2,non-http,openssl,schannel,ssh,ssl,sspi,winldap,zstd] --triplet x64-windows-static

  • missing protocol on Windows: rtmp, rtmpe, rtmps, rtmpt, rtmpte, rtmpts

  • callback frequency increased: from every 1 second to every 100 milliseconds max

  • removed Windows 32-bit support

  • JSON parameters are now native objects:

Text:=cURL_VersionInfo()
Object:=cURL_VersionInfo()
 
Long:=cURL(Text;Blob;Blob;Text;Text;Text)
Object:=cURL(Object;Blob;Blob;Text)

curl_callback_method(Text;Text) => Bool
curl_callback_method(Object;Text) => Bool
  • integrated high-level FTP commands in 4.0.0

FTP high-level commands

new syntax for cURL_FTP_Receive and cURL_FTP_Send

Parameter Type Description
options OBJECT
data BLOB
callbackMethod TEXT optional
status OBJECT

use CURLOPT_READDATA CURLOPT_WRITEDATA to specify a path in/out (same as cURL)

otherwise pass a BLOB in $2

new syntax for all other commands

Parameter Type Description
options OBJECT
callbackMethod TEXT optional
status OBJECT

use FTP_CREATE_MISSING_DIRS option with cURL_FTP_Send and cURL_FTP_MakeDir

use WILDCARDMATCH option with cURL_FTP_Receive


Properties of curlInfo

conditionUnmet
contentLengthUpload
rtspClientCseq
rtspServerCseq
rtspCseqRecv
lastSocket
primaryPort
localPort
contentLengthDownload
connectCode
fileTime
totalTime
requestSize
headerSize
speedUpload
speedDownload
sizeDownload
sizeUpload
httpAuthAvail
proxyAuthAvail
osErrNo
numConnects
responseCode
nameLookupTime
connectTime
appConnectTime
preTransferTime
startTransferTime
redirectTime
sslVerifyResult
redirectCount
effectiveUrl
localIp
contentType
primaryIp
redirectUrl
ftpEntryPath
rtspSessionId

Special options

Value Type Description
PRIVATE TEXT context info passed to callbackMethod
READDATA TEXT use file path instead of request
WRITEDATA TEXT use file path instead of response
AUTOPROXY LONGINT 1 to use libproxy
ATOMIC BOOLEAN True to use simple (as opposed to multiple) API
DEBUG TEXT folder path to create log files
FTP_USE_MLSD BOOLEAN True to use MLSD instead of LIST

Standard options

Value Type Description
URL TEXT
PORT LONGINT
PROXY TEXT
USERPWD TEXT
PROXYUSERPWD TEXT
RANGE TEXT
TIMEOUT LONGINT
REFERER TEXT
FTPPORT TEXT
USERAGENT TEXT
LOW_SPEED_LIMIT LONGINT
LOW_SPEED_TIME LONGINT
RESUME_FROM LONGINT
COOKIE TEXT
SSLCERT TEXT path
KEYPASSWD TEXT
CRLF LONGINT
COOKIEFILE TEXT path
TIMEVALUE LONGINT
CUSTOMREQUEST TEXT
HEADER LONGINT
NOBODY LONGINT
FAILONERROR LONGINT
UPLOAD LONGINT
POST LONGINT
DIRLISTONLY LONGINT
APPEND LONGINT
NETRC LONGINT
FOLLOWLOCATION LONGINT
PUT LONGINT
AUTOREFERER LONGINT
PROXYPORT LONGINT
HTTPPROXYTUNNEL LONGINT
INTERFACE TEXT
KRBLEVEL TEXT
SSL_VERIFYPEER LONGINT
CAINFO TEXT path
MAXREDIRS LONGINT
FILETIME LONGINT
MAXCONNECTS LONGINT
FRESH_CONNECT LONGINT
FORBID_REUSE LONGINT
RANDOM_FILE TEXT
EGDSOCKET TEXT
CONNECTTIMEOUT LONGINT
HTTPGET LONGINT
SSL_VERIFYHOST LONGINT
COOKIEJAR TEXT path
SSL_CIPHER_LIST TEXT
FTP_USE_EPSV LONGINT
SSLCERTTYPE TEXT
SSLKEY TEXT path
SSLKEYTYPE TEXT
DNS_CACHE_TIMEOUT LONGINT
COOKIESESSION LONGINT
CAPATH TEXT path
BUFFERSIZE LONGINT
ACCEPT_ENCODING TEXT
UNRESTRICTED_AUTH LONGINT
FTP_USE_EPRT LONGINT
HTTPAUTH LONGINT
FTP_CREATE_MISSING_DIRS LONGINT
PROXYAUTH LONGINT
FTP_RESPONSE_TIMEOUT LONGINT
IPRESOLVE LONGINT
MAXFILESIZE LONGINT
RESUME_FROM_LARGE TEXT text, to support 64-bit integer
MAXFILESIZE_LARGE TEXT text, to support 64-bit integer
NETRC_FILE TEXT path
FTP_ACCOUNT TEXT
COOKIELIST TEXT
IGNORE_CONTENT_LENGTH LONGINT
FTP_SKIP_PASV_IP LONGINT
FTP_FILEMETHOD LONGINT
LOCALPORT LONGINT
LOCALPORTRANGE LONGINT
CONNECT_ONLY LONGINT
MAX_SEND_SPEED_LARGE TEXT text, to support 64-bit integer
MAX_RECV_SPEED_LARGE TEXT text, to support 64-bit integer
FTP_ALTERNATIVE_TO_USER TEXT
SSL_SESSIONID_CACHE LONGINT
SSH_AUTH_TYPES LONGINT
SSH_PUBLIC_KEYFILE TEXT path
SSH_PRIVATE_KEYFILE TEXT path
FTP_SSL_CCC LONGINT
TIMEOUT_MS LONGINT
CONNECTTIMEOUT_MS LONGINT
HTTP_TRANSFER_DECODING LONGINT
HTTP_CONTENT_DECODING LONGINT
NEW_FILE_PERMS LONGINT
NEW_DIRECTORY_PERMS LONGINT
POSTREDIR LONGINT
SSH_HOST_PUBLIC_KEY_MD5 TEXT
PROXY_TRANSFER_MODE LONGINT
CRLFILE TEXT path
ISSUERCERT TEXT path
ADDRESS_SCOPE LONGINT
CERTINFO LONGINT
USERNAME TEXT
PASSWORD TEXT
PROXYUSERNAME TEXT
PROXYPASSWORD TEXT
NOPROXY TEXT
TFTP_BLKSIZE LONGINT
PROTOCOLS LONGINT
REDIR_PROTOCOLS LONGINT
SSH_KNOWNHOSTS TEXT
FTP_USE_PRET LONGINT
RTSP_REQUEST LONGINT
RTSP_SESSION_ID TEXT
RTSP_STREAM_URI TEXT
RTSP_TRANSPORT TEXT
RTSP_CLIENT_CSEQ LONGINT
RTSP_SERVER_CSEQ LONGINT
WILDCARDMATCH LONGINT
TLSAUTH_USERNAME TEXT
TLSAUTH_PASSWORD TEXT
TLSAUTH_TYPE TEXT
TRANSFER_ENCODING LONGINT
DNS_SERVERS TEXT
ACCEPTTIMEOUT_MS LONGINT
TCP_KEEPALIVE LONGINT
TCP_KEEPIDLE LONGINT
TCP_KEEPINTVL LONGINT
MAIL_AUTH TEXT
SASL_IR LONGINT
XOAUTH2_BEARER TEXT
DNS_INTERFACE TEXT
DNS_LOCAL_IP4 TEXT
DNS_LOCAL_IP6 TEXT
LOGIN_OPTIONS TEXT
SSL_ENABLE_NPN LONGINT
SSL_ENABLE_ALPN LONGINT
EXPECT_100_TIMEOUT_MS LONGINT
HEADEROPT LONGINT
PINNEDPUBLICKEY TEXT path or value
SSL_VERIFYSTATUS LONGINT
SSL_FALSESTART LONGINT
PATH_AS_IS LONGINT
PROXY_SERVICE_NAME TEXT
SERVICE_NAME TEXT
PIPEWAIT LONGINT
DEFAULT_PROTOCOL TEXT
STREAM_WEIGHT LONGINT
TFTP_NO_OPTIONS LONGINT
TCP_FASTOPEN LONGINT
KEEP_SENDING_ON_ERROR LONGINT
PROXY_CAINFO TEXT path
PROXY_CAPATH TEXT path
PROXY_SSL_VERIFYPEER LONGINT
PROXY_SSL_VERIFYHOST LONGINT
PROXY_TLSAUTH_USERNAME TEXT
PROXY_TLSAUTH_PASSWORD TEXT
PROXY_TLSAUTH_TYPE TEXT
PROXY_SSLCERT TEXT path
PROXY_SSLCERTTYPE TEXT
PROXY_SSLKEY TEXT path
PROXY_SSLKEYTYPE TEXT
PROXY_KEYPASSWD TEXT
PROXY_SSL_CIPHER_LIST TEXT
PROXY_CRLFILE TEXT path
PROXY_SSL_OPTIONS LONGINT
PRE_PROXY TEXT
PROXY_PINNEDPUBLICKEY TEXT
SUPPRESS_CONNECT_HEADERS LONGINT
REQUEST_TARGET TEXT
SOCKS5_AUTH LONGINT
SSH_COMPRESSION LONGINT
TIMEVALUE_LARGE TEXT 64-bit integer
HAPPY_EYEBALLS_TIMEOUT_MS LONGINT
HAPROXYPROTOCOL LONGINT
DNS_SHUFFLE_ADDRESSES LONGINT
TLS13_CIPHERS TEXT
PROXY_TLS13_CIPHERS TEXT
DISALLOW_USERNAME_IN_URL LONGINT
DOH_URL TEXT
UPLOAD_BUFFERSIZE LONGINT
UPKEEP_INTERVAL_MS LONGINT

Standard options with constant support

Value Type Description
USE_SSL TEXT USESSL_NONE, USESSL_TRY, USESSL_CONTROL, USESSL_ALL
SSLVERSION TEXT SSLVERSION_TLSv1, SSLVERSION_SSLv2, SSLVERSION_SSLv3, SSLVERSION_TLSv1_0, SSLVERSION_TLSv1_1, SSLVERSION_TLSv1_2, SSLVERSION_TLSv1_3
HTTP_VERSION TEXT HTTP_VERSION_1_0, HTTP_VERSION_1_1, HTTP_VERSION_2_0, HTTP_VERSION_2TLS, HTTP_VERSION_2_PRIOR_KNOWLEDGE
PROXY_SSLVERSION TEXT SSLVERSION_TLSv1, SSLVERSION_SSLv2, SSLVERSION_SSLv3, SSLVERSION_TLSv1_0, SSLVERSION_TLSv1_1, SSLVERSION_TLSv1_2, SSLVERSION_TLSv1_3
TIMECONDITION TEXT TIMECOND_IFMODSINCE, TIMECOND_IFUNMODSINCE, TIMECOND_LASTMOD
PROXYTYPE TEXT PROXY_HTTPS, PROXY_SOCKS4, PROXY_SOCKS4A, PROXY_SOCKS5
FTPSSLAUTH TEXT FTPAUTH_SSL, FTPAUTH_TLS
HEADEROPT TEXT HEADER_UNIFIED, HEADER_SEPARATE

Standard options with collection support

Value Type Description
CONNECT_TO COLLECTION text array
PROXYHEADER COLLECTION text array
HTTPHEADER COLLECTION text array
HTTP200ALIASES COLLECTION text array
RESOLVE COLLECTION text array
MAIL_RCPT COLLECTION text array
MAIL_FROM TEXT
PREQUOTE COLLECTION text array
POSTQUOTE COLLECTION text array
QUOTE COLLECTION text array
TELNETOPTIONS COLLECTION text array

Not supported

POSTFIELDSIZE_LARGE (automatic)
INFILESIZE_LARGE (automatic)
POSTFIELDS
VERBOSE
NOPROGRESS
READFUNCTION
WRITEFUNCTION
ERRORBUFFER
READDATA
WRITEDATA
OBSOLETE72
PROGRESSDATA
PROGRESSFUNCTION
TRANSFERTEXT
OBSOLETE40
STDERR
HEADERDATA
HTTPPOST
IOCTLDATA
IOCTLFUNCTION
TCP_NODELAY
SSL_CTX_DATA
SSL_CTX_FUNCTION
SHARE
NOSIGNAL
DEBUGDATA
DEBUGFUNCTION
DNS_USE_GLOBAL_CACHE
SSLENGINE_DEFAULT
SSLENGINE
HEADERFUNCTION
SEEKDATA
SEEKFUNCTION
COPYPOSTFIELDS
OPENSOCKETDATA
OPENSOCKETFUNCTION
SOCKOPTDATA
SOCKOPTFUNCTION
CONV_FROM_UTF8_FUNCTION
CONV_TO_NETWORK_FUNCTION
CONV_FROM_NETWORK_FUNCTION
GSSAPI_DELEGATION
SOCKS5_GSSAPI_NEC
SOCKS5_GSSAPI_SERVICE
CLOSESOCKETDATA
CLOSESOCKETFUNCTION
FNMATCH_DATA
CHUNK_DATA
FNMATCH_FUNCTION
CHUNK_END_FUNCTION
CHUNK_BGN_FUNCTION
INTERLEAVEFUNCTION
INTERLEAVEDATA
SSH_KEYDATA
SSH_KEYFUNCTION
STREAM_DEPENDS_E
STREAM_DEPENDS
UNIX_SOCKET_PATH
XFERINFOFUNCTION
SSL_OPTIONS
ABSTRACT_UNIX_SOCKET
MIMEPOST
RESOLVER_START_FUNCTION
RESOLVER_START_DATA


Tips

  • SMTP

You might want to enable FORBID_REUSE if your plan is to use different credentials in a batch process. By default, cURL re-uses the TCP connection, which may not be what you want.

You can pass a collection or string to MAIL_TO. But you can only pass string to MAIL_FROM.

You must pass a simple email adress to MAIL_FROM. You can NOT pass the email address with a display name, as you would do for the SMTP header. (It is your responsibility to include a well-formatted From header in the SMTP request.

  • Any

By default, cURL has a very tolerant timeout setting. In production, you might want to explicitly set all the timeout options.

About

Generic network client based on libcurl

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages