update_subsciber/
update_subsciber.rs1use mailerlite_rs::{data::Data, response::Response, MailerLite};
2
3#[tokio::main]
4async fn main() {
5 let api_key: String = String::from("Your MailerLite API Key");
6
7 let mailerlite: MailerLite = MailerLite::new(api_key);
8
9 let id: String = String::from("Your Subscriber ID");
10
11 let data: Data = Data::new()
12 .add("fields[name]", "John")
13 .add("fields[last_name]", "Doe");
14
15 let response: Response = mailerlite.subscriber().update(id, data.clone()).await;
16
17 println!("{:#?}", response);
18}