Sample code for 30+ languages & platforms
PureBasic

Example: Http.GetCacheRoot method

Demonstrates the GetCacheRoot method.

Chilkat PureBasic Downloads

PureBasic
IncludeFile "CkHttp.pb"

Procedure ChilkatExample()

    http.i = CkHttp::ckCreate()
    If http.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    ; Establish 2 cache root directories.
    CkHttp::ckAddCacheRoot(http,"c:/example/httpCacheA/")
    CkHttp::ckAddCacheRoot(http,"c:/example/httpCacheB/")

    Debug "Number of cache roots: " + Str(CkHttp::ckNumCacheRoots(http))

    Debug "1st cache root: " + CkHttp::ckGetCacheRoot(http,0)
    Debug "2nd cache root: " + CkHttp::ckGetCacheRoot(http,1)

    ; Output:

    ; Number of cache roots: 2
    ; 1st cache root: c:/example/httpCacheA/
    ; 2nd cache root: c:/example/httpCacheB/


    CkHttp::ckDispose(http)


    ProcedureReturn
EndProcedure