unit HttpCurl;

interface

type

HCkJsonObject = Pointer;
HCkHttpCurl = Pointer;
HCkJsonArray = Pointer;
HCkXml = Pointer;
HCkString = Pointer;
HCkStringBuilder = Pointer;
HCkTask = Pointer;
HCkBinData = Pointer;


// Note: The callback functions use the cdecl calling convention, while all other functions use stdcall.
THttpCurlAbortCheck = function(): Integer; cdecl;
THttpCurlProgressInfo = procedure(name: PWideChar; value: PWideChar); cdecl;
THttpCurlPercentDone = function(pctDone: Integer): Integer; cdecl;
THttpCurlTaskCompleted = procedure(task: HCkTask); cdecl;


function CkHttpCurl_Create: HCkHttpCurl; stdcall;
procedure CkHttpCurl_Dispose(handle: HCkHttpCurl); stdcall;

procedure CkHttpCurl_SetAbortCheck(objHandle: HCkHttpCurl; fn: THttpCurlAbortCheck) stdcall;
procedure CkHttpCurl_SetProgressInfo(objHandle: HCkHttpCurl; fn: THttpCurlProgressInfo) stdcall;
procedure CkHttpCurl_SetPercentDone(objHandle: HCkHttpCurl; fn: THttpCurlPercentDone) stdcall;
procedure CkHttpCurl_SetTaskCompleted(objHandle: HCkHttpCurl; fn: THttpCurlTaskCompleted) stdcall;
procedure CkHttpCurl_getDebugLogFilePath(objHandle: HCkHttpCurl; outPropVal: HCkString); stdcall;

procedure CkHttpCurl_putDebugLogFilePath(objHandle: HCkHttpCurl; newPropVal: PWideChar); stdcall;

function CkHttpCurl__debugLogFilePath(objHandle: HCkHttpCurl): PWideChar; stdcall;

function CkHttpCurl_getEnableBodyVars(objHandle: HCkHttpCurl): wordbool; stdcall;

procedure CkHttpCurl_putEnableBodyVars(objHandle: HCkHttpCurl; newPropVal: wordbool); stdcall;

procedure CkHttpCurl_getFailedCurl(objHandle: HCkHttpCurl; outPropVal: HCkString); stdcall;

function CkHttpCurl__failedCurl(objHandle: HCkHttpCurl): PWideChar; stdcall;

function CkHttpCurl_getFailReason(objHandle: HCkHttpCurl): Integer; stdcall;

function CkHttpCurl_getHeartbeatMs(objHandle: HCkHttpCurl): Integer; stdcall;

procedure CkHttpCurl_putHeartbeatMs(objHandle: HCkHttpCurl; newPropVal: Integer); stdcall;

procedure CkHttpCurl_getLastErrorHtml(objHandle: HCkHttpCurl; outPropVal: HCkString); stdcall;

function CkHttpCurl__lastErrorHtml(objHandle: HCkHttpCurl): PWideChar; stdcall;

procedure CkHttpCurl_getLastErrorText(objHandle: HCkHttpCurl; outPropVal: HCkString); stdcall;

function CkHttpCurl__lastErrorText(objHandle: HCkHttpCurl): PWideChar; stdcall;

procedure CkHttpCurl_getLastErrorXml(objHandle: HCkHttpCurl; outPropVal: HCkString); stdcall;

function CkHttpCurl__lastErrorXml(objHandle: HCkHttpCurl): PWideChar; stdcall;

function CkHttpCurl_getLastMethodSuccess(objHandle: HCkHttpCurl): wordbool; stdcall;

procedure CkHttpCurl_putLastMethodSuccess(objHandle: HCkHttpCurl; newPropVal: wordbool); stdcall;

procedure CkHttpCurl_getResponseBodyStr(objHandle: HCkHttpCurl; outPropVal: HCkString); stdcall;

function CkHttpCurl__responseBodyStr(objHandle: HCkHttpCurl): PWideChar; stdcall;

procedure CkHttpCurl_getResponseFilePath(objHandle: HCkHttpCurl; outPropVal: HCkString); stdcall;

procedure CkHttpCurl_putResponseFilePath(objHandle: HCkHttpCurl; newPropVal: PWideChar); stdcall;

function CkHttpCurl__responseFilePath(objHandle: HCkHttpCurl): PWideChar; stdcall;

function CkHttpCurl_getStatusCode(objHandle: HCkHttpCurl): Integer; stdcall;

procedure CkHttpCurl_getUncommonOptions(objHandle: HCkHttpCurl; outPropVal: HCkString); stdcall;

procedure CkHttpCurl_putUncommonOptions(objHandle: HCkHttpCurl; newPropVal: PWideChar); stdcall;

function CkHttpCurl__uncommonOptions(objHandle: HCkHttpCurl): PWideChar; stdcall;

function CkHttpCurl_getVerboseLogging(objHandle: HCkHttpCurl): wordbool; stdcall;

procedure CkHttpCurl_putVerboseLogging(objHandle: HCkHttpCurl; newPropVal: wordbool); stdcall;

procedure CkHttpCurl_getVersion(objHandle: HCkHttpCurl; outPropVal: HCkString); stdcall;

function CkHttpCurl__version(objHandle: HCkHttpCurl): PWideChar; stdcall;

function CkHttpCurl_AddFunction(objHandle: HCkHttpCurl; funcName: PWideChar; curl: PWideChar): wordbool; stdcall;

function CkHttpCurl_AddOutput(objHandle: HCkHttpCurl; funcName: PWideChar; jsonPath: PWideChar; varName: PWideChar): wordbool; stdcall;

function CkHttpCurl_AddOutput2(objHandle: HCkHttpCurl; funcName: PWideChar; arrayPath: PWideChar; wherePath: PWideChar; whereValue: PWideChar; caseSensitive: wordbool; subPath: PWideChar; varName: PWideChar): wordbool; stdcall;

procedure CkHttpCurl_AddTargetOutput(objHandle: HCkHttpCurl; jsonPath: PWideChar; varName: PWideChar); stdcall;

procedure CkHttpCurl_ClearTargetOutput(objHandle: HCkHttpCurl; varName: PWideChar); stdcall;

procedure CkHttpCurl_ClearVar(objHandle: HCkHttpCurl; varName: PWideChar); stdcall;

function CkHttpCurl_DoYourThing(objHandle: HCkHttpCurl; targetCurl: PWideChar): wordbool; stdcall;

function CkHttpCurl_DoYourThingAsync(objHandle: HCkHttpCurl; targetCurl: PWideChar): HCkTask; stdcall;

function CkHttpCurl_ExaminePlan(objHandle: HCkHttpCurl; curl: PWideChar; json: HCkJsonObject): wordbool; stdcall;

procedure CkHttpCurl_GetAllVars(objHandle: HCkHttpCurl; json: HCkJsonObject); stdcall;

function CkHttpCurl_GetResponseBd(objHandle: HCkHttpCurl; bd: HCkBinData): wordbool; stdcall;

function CkHttpCurl_GetResponseJarr(objHandle: HCkHttpCurl; jarr: HCkJsonArray): wordbool; stdcall;

function CkHttpCurl_GetResponseJson(objHandle: HCkHttpCurl; json: HCkJsonObject): wordbool; stdcall;

function CkHttpCurl_GetResponseSb(objHandle: HCkHttpCurl; sb: HCkStringBuilder): wordbool; stdcall;

function CkHttpCurl_GetResponseXml(objHandle: HCkHttpCurl; xml: HCkXml): wordbool; stdcall;

function CkHttpCurl_GetVar(objHandle: HCkHttpCurl; varName: PWideChar; outStr: HCkString): wordbool; stdcall;

function CkHttpCurl__getVar(objHandle: HCkHttpCurl; varName: PWideChar): PWideChar; stdcall;

function CkHttpCurl_SetAuth(objHandle: HCkHttpCurl; json: HCkJsonObject): wordbool; stdcall;

procedure CkHttpCurl_SetVar(objHandle: HCkHttpCurl; varName: PWideChar; varValue: PWideChar); stdcall;

function CkHttpCurl_ToRawRequest(objHandle: HCkHttpCurl; curlCommand: PWideChar; sb: HCkStringBuilder): wordbool; stdcall;

function CkHttpCurl_VarDefined(objHandle: HCkHttpCurl; varName: PWideChar): wordbool; stdcall;

implementation

{$Include chilkatDllPath.inc}

function CkHttpCurl_Create; external DLLName;
procedure CkHttpCurl_Dispose; external DLLName;

procedure CkHttpCurl_SetAbortCheck; external DLLName;
procedure CkHttpCurl_SetProgressInfo; external DLLName;
procedure CkHttpCurl_SetPercentDone; external DLLName;
procedure CkHttpCurl_SetTaskCompleted; external DLLName;
procedure CkHttpCurl_getDebugLogFilePath; external DLLName;
procedure CkHttpCurl_putDebugLogFilePath; external DLLName;
function CkHttpCurl__debugLogFilePath; external DLLName;
function CkHttpCurl_getEnableBodyVars; external DLLName;
procedure CkHttpCurl_putEnableBodyVars; external DLLName;
procedure CkHttpCurl_getFailedCurl; external DLLName;
function CkHttpCurl__failedCurl; external DLLName;
function CkHttpCurl_getFailReason; external DLLName;
function CkHttpCurl_getHeartbeatMs; external DLLName;
procedure CkHttpCurl_putHeartbeatMs; external DLLName;
procedure CkHttpCurl_getLastErrorHtml; external DLLName;
function CkHttpCurl__lastErrorHtml; external DLLName;
procedure CkHttpCurl_getLastErrorText; external DLLName;
function CkHttpCurl__lastErrorText; external DLLName;
procedure CkHttpCurl_getLastErrorXml; external DLLName;
function CkHttpCurl__lastErrorXml; external DLLName;
function CkHttpCurl_getLastMethodSuccess; external DLLName;
procedure CkHttpCurl_putLastMethodSuccess; external DLLName;
procedure CkHttpCurl_getResponseBodyStr; external DLLName;
function CkHttpCurl__responseBodyStr; external DLLName;
procedure CkHttpCurl_getResponseFilePath; external DLLName;
procedure CkHttpCurl_putResponseFilePath; external DLLName;
function CkHttpCurl__responseFilePath; external DLLName;
function CkHttpCurl_getStatusCode; external DLLName;
procedure CkHttpCurl_getUncommonOptions; external DLLName;
procedure CkHttpCurl_putUncommonOptions; external DLLName;
function CkHttpCurl__uncommonOptions; external DLLName;
function CkHttpCurl_getVerboseLogging; external DLLName;
procedure CkHttpCurl_putVerboseLogging; external DLLName;
procedure CkHttpCurl_getVersion; external DLLName;
function CkHttpCurl__version; external DLLName;
function CkHttpCurl_AddFunction; external DLLName;
function CkHttpCurl_AddOutput; external DLLName;
function CkHttpCurl_AddOutput2; external DLLName;
procedure CkHttpCurl_AddTargetOutput; external DLLName;
procedure CkHttpCurl_ClearTargetOutput; external DLLName;
procedure CkHttpCurl_ClearVar; external DLLName;
function CkHttpCurl_DoYourThing; external DLLName;
function CkHttpCurl_DoYourThingAsync; external DLLName;
function CkHttpCurl_ExaminePlan; external DLLName;
procedure CkHttpCurl_GetAllVars; external DLLName;
function CkHttpCurl_GetResponseBd; external DLLName;
function CkHttpCurl_GetResponseJarr; external DLLName;
function CkHttpCurl_GetResponseJson; external DLLName;
function CkHttpCurl_GetResponseSb; external DLLName;
function CkHttpCurl_GetResponseXml; external DLLName;
function CkHttpCurl_GetVar; external DLLName;
function CkHttpCurl__getVar; external DLLName;
function CkHttpCurl_SetAuth; external DLLName;
procedure CkHttpCurl_SetVar; external DLLName;
function CkHttpCurl_ToRawRequest; external DLLName;
function CkHttpCurl_VarDefined; external DLLName;



end.
