|
|
|
@ -55,14 +55,13 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let update = Client::new()
|
|
|
|
|
.put(format!("https://files.nickiel.net/index.php/apps/notes/api/v1/notes/{}", cfg.note_id.clone()))
|
|
|
|
|
Client::new()
|
|
|
|
|
.put(format!("https://{}/index.php/apps/notes/api/v1/notes/{}", cfg.server_url.clone(), cfg.note_id.clone()))
|
|
|
|
|
.header("Accept", "application/json")
|
|
|
|
|
.header("Content-Type", "application/json")
|
|
|
|
|
.basic_auth(cfg.user.clone(), Some(cfg.pswd.clone()))
|
|
|
|
|
.body(serde_json::to_string(&NoteUpdate {content: body_content}).unwrap());
|
|
|
|
|
|
|
|
|
|
//println!("{:#?}", update.send()?.json::<Note>()?);
|
|
|
|
|
.body(serde_json::to_string(&NoteUpdate {content: body_content}).unwrap())
|
|
|
|
|
.send()?;
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
@ -90,6 +89,7 @@ struct Config {
|
|
|
|
|
user: String,
|
|
|
|
|
pswd: String,
|
|
|
|
|
note_id: String,
|
|
|
|
|
server_url: String
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Default for Config {
|
|
|
|
@ -98,6 +98,7 @@ impl Default for Config {
|
|
|
|
|
user: "".to_string(),
|
|
|
|
|
pswd: "".to_string(),
|
|
|
|
|
note_id: "".to_string(),
|
|
|
|
|
server_url: "".to_string(),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|