Rust
Rust
Shopware Digest Authentication
See more Shopware Examples
Demonstrates using Digest access authentication for Shopware.Chilkat Rust Downloads
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
let http = chilkat::Http::new();
// To use HTTP Digest Authentication, set the login and password, and also indicate that DigestAuth should be used.
http.set_login("api_username");
http.set_password("api_key");
http.set_digest_auth(true);
let sb_response_body = chilkat::StringBuilder::new();
if http.quick_get_sb("https://my-shopware-shop.com/api/articles?limit=2", &sb_response_body).is_err() {
println!("{}", http.last_error_text());
return;
}
let j_resp = chilkat::JsonObject::new();
let _ = j_resp.load_sb(&sb_response_body);
j_resp.set_emit_compact(false);
println!("Response Body:");
println!("{}", j_resp.emit().unwrap_or_default());