Sample code for 30+ languages & platforms
React Native

Example: Http.GetCacheRoot method

Demonstrates the GetCacheRoot method.

Chilkat React Native Downloads

React Native
import { Http } from '@chilkat/react-native'

function chilkatExample() {
  const http = new Http();

  // Establish 2 cache root directories.
  http.addCacheRoot('c:/example/httpCacheA/');
  http.addCacheRoot('c:/example/httpCacheB/');

  console.log(`Number of cache roots: ${http.numCacheRoots}`);

  console.log(`1st cache root: ${http.getCacheRoot(0)}`);
  console.log(`2nd cache root: ${http.getCacheRoot(1)}`);

  // Output:

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