React Native Requires Chilkat v11.0.0+
React Native
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 React Native Downloads
import { Http, HttpResponse } from '@chilkat/react-native'
async function chilkatExample() {
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
const http = new Http();
// XML to send in the body of the HTTPS POST
const xmlStr = '...';
const urlEndpoint = 'https://apicert.sii.cl/recursos/v1/boleta.electronica.token';
const xmlCharset = 'utf-8';
const resp = new HttpResponse();
try {
await http.httpStrAsync('POST', urlEndpoint, xmlStr, 'utf-8', 'application/xml', resp);
} catch {
console.log(http.lastErrorText);
return;
}
// Get the response status code and body
console.log(`response status code = ${resp.statusCode}`);
// This would be the XML response sent by the server.
console.log(resp.bodyStr);
}