Rust
Rust
Shopify Basic Authentication: Get List of Products
See more Shopify Examples
Demonstrates how to send a simple HTTP GET request with Basic authentication to get a list of products.Chilkat Rust Downloads
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
let http = chilkat::Http::new();
// Use your Shopify store's Admin API key and password.
http.set_login("admin3_api_key");
http.set_password("admin3_password");
http.set_basic_auth(true);
let Ok(json_str) = http.quick_get_str("https://mystore.myshopify.com/admin/api/2020-07/products.json") else {
println!("{}", http.last_error_text());
return;
};
println!("Response status code: {}", http.last_status());
println!("JSON response:");
println!("{}", json_str);