Sample code for 30+ languages & platforms
Rust

HTTP Download from URL with IP Address and Port

See more HTTP Examples

Downloads a file from a URL using an IP address and port.

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();

http.set_request_header("Host", "chilkatsoft.com");

let local_file_path = "/temp/hamlet.zip".to_string();
if http.download("http://107.180.46.206:80/hamlet.zip", &local_file_path).is_err() {
    println!("{}", http.last_error_text());
    return;
}

println!("OK!");