Sample code for 30+ languages & platforms
Rust 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 Rust Downloads

Rust

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

let http = chilkat::Http::new();

// XML to send in the body of the HTTPS POST
let xml_str = "...".to_string();

let url_endpoint = "https://apicert.sii.cl/recursos/v1/boleta.electronica.token".to_string();
let xml_charset = "utf-8".to_string();

let resp = chilkat::HttpResponse::new();
if http.http_str("POST", &url_endpoint, &xml_str, "utf-8", "application/xml", &resp).is_err() {
    println!("{}", http.last_error_text());
    return;
}

// Get the response status code and body
println!("response status code = {}", resp.status_code());

// This would be the XML response sent by the server.
println!("{}", resp.body_str());