Rust Requires Chilkat v11.0.0+
Rust
Example: Http.GetLastJsonData method
Demonstrates theGetLastJsonData method.
Chilkat Rust Downloads
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"
// }
// }