1 unstable release
0.1.1 | Aug 29, 2023 |
---|
#561 in HTTP client
14KB
316 lines
txts.rs
Rust library for interacting with txts
Examples
Initializing client
let host = Url::parse("https://txts.sudokoko.xyz/").unwrap();
let client = TxtsClient::new(host)?;
Getting page info
let page = client.get("username").await?;
println!("Verified: {}", page.verified);
println!("HTML: {}", page.html_content);
Getting page content in markdown
let markdown = client.get_markdown("username").await?;
Creating page
let (page, secret) = client.create("username", "content").await?;
Editing page
let secret = Uuid::parse_str("Secret here").unwrap();
let edited_page = client.edit("username", &secret, "content").await?;
Dependencies
~9–23MB
~375K SLoC