Sample code for 30+ languages & platforms
Dart

Example: Http.QuickGetSb method

Demonstrates the QuickGetSb method.

Chilkat Dart Downloads

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

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

  // Send the HTTP GET and return the content in a StringBuilder
  final sb = CkStringBuilder();
  try {
    http.quickGetSb('https://www.chilkatsoft.com/helloWorld.json', sb);
  } on ChilkatException catch (e) {
    if (http.lastStatus == 0) {
      // Communications error.  We did not get a response.
      print(e.lastErrorText);
    } else {
      print('Response status code: ${http.lastStatus}');
      print('Response body error text:');
      print(sb.getAsString());
    }

    return;
  }

  // The downloaded content:
  print(sb.getAsString());
  print('Success');
}