Skip to content
Jens Arnt / iDoer Aps edited this page Apr 1, 2019 · 4 revisions

Welcome to the CurlWrapper wiki!

Using CurlWrapper from LotusScript ... Examples of declarations and defines

Declare Function NotesCurlEasyInit Lib "libCurlWrapper.so" Alias "notes_curl_easy_init" () As Long
Declare Function NotesNativeCurlHandle Lib "libCurlWrapper.so" Alias "notes_get_native_curl_handle" (ByVal notes_curl_handle As Long) As Double
Declare Sub NotesCurlEasyCleanup Lib "libCurlWrapper.so" Alias "notes_curl_easy_cleanup" (ByVal curl As Long)
Declare Function NotesCurlEasyPerform Lib "libCurlWrapper.so" Alias "notes_easy_curl_perform" (ByVal curl As Long) As String
Declare Function NotesCurlEasyGetInfoLong Lib "libCurlWrapper.so" Alias "notes_easy_curl_getinfo_long" (ByVal curl As Long, ByVal info As Long ) As Long
Declare Function NotesCurlEasyGetInfoChar Lib "libCurlWrapper.so" Alias "notes_easy_curl_getinfo_char" (ByVal curl As Long, ByVal info As Long ) As String
Declare Function NotesCurlEasyGetLastCurle Lib "libCurlWrapper.so" Alias "notes_easy_curl_getlast_curle" (ByVal curl As Long) As Long

Declare Function CurlVersion Lib "libcurl.so.3" Alias "curl_version" () As String
Declare Sub CurlEasySetopt Lib "libcurl.so.3" Alias "curl_easy_setopt" (ByVal curl As Double, ByVal an_option As Long, ByVal param As String)
Declare Sub CurlEasyCleanup Lib "libcurl.so.3" Alias "curl_easy_cleanup" (ByVal curl As Double)
Declare Function CurlSlistAppend Lib "libcurl.so.3" Alias "curl_slist_append" (ByVal slist As string, ByVal thechar as String ) As string

Const CURLOPT_URL            = 10002 ' https://github.com/curl/curl/blob/master/include/curl/curl.h#L915
Const CURLOPT_ERRORBUFFER    = 10010 '
Const CURLOPT_WRITEFUNCTION  = 20011 ' https://github.com/curl/curl/blob/master/include/curl/curl.h#L943
Const CURLOPT_TIMEOUT        =    13 ' https://github.com/curl/curl/blob/master/include/curl/curl.h#L950
Const CURLOPT_FOLLOWLOCATION =    52 ' LONG
Const CURLOPT_HEADEROPT      =   229 ' LONG
Const CURLOPT_HEADERDATA     =    29 ' OBJECTPOINT
Const CURLOPT_HEADER         =    42 ' LONG       ' throw thetoo  header ou
Const CURLOPT_POST           = 47    ' LONG         ' HTTP POST method
Const CURLOPT_HTTPGET        = 80    ' LONG      ' HTTP GET method (default) using if POST has been used

Const CURLOPT_USERAGENT      = 18    ' STRINGPOINT
Const CURLOPT_REFERER        = 16    ' STRINGPOINT

Const CURLOPT_USERPWD        = 5     '    for fetching Password

Const CURLOPT_USERNAME       = 173 ' STRINGPOINT ' "name" and "pwd" to use when fetching
Const CURLOPT_PASSWORD       = 174 ' STRINGPOINT ' "name" and "pwd" to use when fetching

Const CURLINFO_EFFECTIVE_URL = &H100001 ' https://github.com/curl/curl/blob/master/include/curl/curl.h#L2441
Const CURLINFO_RESPONSE_CODE = &H200002 ' https://github.com/curl/curl/blob/master/include/curl/curl.h#L2442

Const CURLE_OK                       =  0
Const CURLE_COULDNT_RESOLVE_HOST     =  6
Const CURLE_OPERATION_TIMEDOUT       = 28 ' the timeout time was reached
Clone this wiki locally