Rust
Rust
Example: Http.QuickGetStr method
Demonstrates theQuickGetStr method.
Chilkat Rust Downloads
let http = chilkat::Http::new();
// Keep the response body if there's an error.
http.set_keep_response_body(true);
// Send the HTTP GET and return the content in a string.
let Ok(str) = http.quick_get_str("https://www.chilkatsoft.com/helloWorld.json") else {
if http.last_status() == 0 {
// Communications error. We did not get a response.
println!("{}", http.last_error_text());
} else {
println!("Response status code: {}", http.last_status());
println!("Response body error text:");
println!("{}", http.last_response_body());
}
return;
};
println!("{}", str);
println!("Success");