telegraph-api-rs

Crates.io Crates.io CI docs.rs

Rust implementation of Telegraph API

Quick start

Add dependency to the Cargo.toml toml [dependencies] telegraph-api-rs = "0.1.2"

Create account

```rust use telegraphapirs::{Telegraph, Request};

let telegraph = Telegraph::new(); let account = telegraph.createaccount() .shortname("Short name") .author_name("Author name") .send() .unwrap(); ```

Upload media files

```rust use telegraphapirs::Telegraph;

let telegraph = Telegraph::new(); let files = vec!["1.jpg", "2.png"]; let media = telegraph.upload(&files); You can upload media with custom client rust use telegraphapirs::Telegraph; use reqwest::blocking::Client;

let client = Client::new(); let files = vec!["1.jpg", "2.png"]; let media = Telegraph::upload_with(&client, &files); ``` More examples in the documentation