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

Example: Http.GetLastJsonData method

Demonstrates the GetLastJsonData method.

Chilkat Rust Downloads

Rust

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

// Only allow TLS 1.2 or better.
http.set_ssl_protocol("TLS 1.2 or higher");

if http.http_no_body("GET", "https://google.com/", &resp).is_err() {
    println!("{}", http.last_error_text());
    return;
}

let json = chilkat::JsonObject::new();
json.set_emit_compact(false);

http.get_last_json_data(&json);
println!("{}", json.emit().unwrap_or_default());

// 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"
//   }
// }