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

Example: Http.GetLastJsonData method

Demonstrates the GetLastJsonData method.

Chilkat Dart Downloads

Dart
import 'package:chilkat/chilkat.dart';

void main() {
  final http = CkHttp();
  final resp = CkHttpResponse();

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

  try {
    http.httpNoBody('GET', 'https://google.com/', resp);
  } on ChilkatException catch (e) {
    print(e.lastErrorText);
    return;
  }

  final json = CkJsonObject();
  json.emitCompact = false;

  http.getLastJsonData(json);
  print(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"
  //   }
  // }
}