Sample code for 30+ languages & platforms
C

Example: Http.GetCacheRoot method

Demonstrates the GetCacheRoot method.

Chilkat C Downloads

C
#include <C_CkHttp.h>

void ChilkatSample(void)
    {
    HCkHttp http;

    http = CkHttp_Create();

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

    printf("Number of cache roots: %d\n",CkHttp_getNumCacheRoots(http));

    printf("1st cache root: %s\n",CkHttp_getCacheRoot(http,0));
    printf("2nd cache root: %s\n",CkHttp_getCacheRoot(http,1));

    //  Output:

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


    CkHttp_Dispose(http);

    }