rspaste 0.1.2

📄 A simple and fast JSPaste API wrapper for Rust.
Documentation

Installation

Put the desired version of the crate into the dependencies section of your Cargo.toml:

[dependencies]
rspaste = "*"

Examples

First of all, JSPaste API can return errors if a key or secret is invalid, so a good way of handling responses is:

match some_doc {
    Ok(d) => todo!(), // ...
    Err(e) => todo!() // ...
}

We recommend doing this with every request to ensure that all cases are covered.

use rspaste;

fn main() {
    let doc = rspaste::api::get("key"); // get document
    let posted_doc = rspaste::api::post("content"); // post document
    let deleted_doc = rspaste::api::delete("key", "secret"); // delete document
}