mangadex_api::v5::cover::manga_id

Module post

Source
Expand description

Builder for uploading a new manga cover.

https://api.mangadex.org/swagger.html#/Cover/upload-cover

use uuid::Uuid;

use mangadex_api::MangaDexClient;
use mangadex_api_types::{Language, /*Password, Username*/};

let client = MangaDexClient::default();

/*
    let _login_res = client
        .auth()
        .login()
        .username(Username::parse("myusername")?)
        .password(Password::parse("hunter23")?)
        .build()?
        .send()
        .await?;
*/

let manga_id = Uuid::new_v4();
let file_bytes = vec![0];
let res = client
    .cover()
    .manga_id(manga_id)
    .post()
    .file(file_bytes)
    .locale(Language::English)
    .send()
    .await?;

println!("upload cover: {:?}", res);

Structsยง