Sample code for 30+ languages & platforms
React Native Requires Chilkat v11.0.0+

Example: Http.GetLastJsonData method

Demonstrates the GetLastJsonData method.

Chilkat React Native Downloads

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

async function chilkatExample() {
  const http = new Http();
  const resp = new HttpResponse();

  // Only allow TLS 1.2 or better.
  http.sslProtocol = 'TLS 1.2 or higher';

  try {
    await http.httpNoBodyAsync('GET', 'https://google.com/', resp);
  } catch {
    console.log(http.lastErrorText);
    return;
  }

  const json = new JsonObject();
  json.emitCompact = false;

  http.getLastJsonData(json);
  console.log(json.emit());

  // Output as of Chilkat v11.1.0
  // Additional information may be added as requested or needed in future versions of Chilkat.

  // {
  //   "tls": {
  //     "params": {
  //       "sniHostname": "www.google.com",
  //       "allowConnectionOnlyIfServerChooses": "TLS 1.2 or higher"
  //     },
  //     "negotiatedTlsVersion": "TLS 1.3"
  //   }
  // }
}