Rust
Rust
Example: Http.GetRequestHeader method
Demonstrates theGetRequestHeader method.
Chilkat Rust Downloads
let http = chilkat::Http::new();
let hdr1 = "X-CSRF-Token".to_string();
let hdr2 = "X-Example".to_string();
http.set_request_header(&hdr1, "Fetch");
http.set_request_header(&hdr2, "123ABC");
println!("{}: {}", hdr1, http.get_request_header(&hdr1).unwrap_or_default());
println!("{}: {}", hdr2, http.get_request_header(&hdr2).unwrap_or_default());
// Output:
// X-CSRF-Token: Fetch
// X-Example: 123ABC