Rust implementation of Telegraph API
Add dependency to the Cargo.toml
toml
[dependencies]
telegraph-api-rs = "0.1.2"
```rust use telegraphapirs::{Telegraph, Request};
let telegraph = Telegraph::new(); let account = telegraph.createaccount() .shortname("Short name") .author_name("Author name") .send() .unwrap(); ```
```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