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

POST XML to https://apicert.sii.cl/recursos/v1/boleta.electronica.token

See more HTTP Misc Examples

Demonstrates how to send an HTTPS POST XML request to POST XML to https://apicert.sii.cl/recursos/v1/boleta.electronica.token and retrieve the response.

Chilkat Dart Downloads

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

void main() {
  // This example assumes the Chilkat API to have been previously unlocked.
  // See Global Unlock Sample for sample code.

  final http = CkHttp();

  // XML to send in the body of the HTTPS POST
  final xmlStr = '...';

  final urlEndpoint = 'https://apicert.sii.cl/recursos/v1/boleta.electronica.token';
  final xmlCharset = 'utf-8';

  final resp = CkHttpResponse();
  try {
    http.httpStr('POST', urlEndpoint, xmlStr, 'utf-8', 'application/xml', resp);
  } on ChilkatException catch (e) {
    print(e.lastErrorText);
    return;
  }

  // Get the response status code and body
  print('response status code = ${resp.statusCode}');

  // This would be the XML response sent by the server.
  print(resp.bodyStr);
}