Log in New API Help About

Using the dpaste.com API with Rust

339 bytes of Rust
Created 4 weeks, 1 day ago by dpaste.com
https://dpaste.com/GG9X5CQLK
SOFT WRAP RAW TEXT DUPLICATE DIFF
use reqwest;

fn main() {
    post();
}

fn post() {
    let params = [("content", "// Rust!"), ("syntax", "rust")];
    let client = reqwest::blocking::Client::new();
    let res = client
        .post("https://dpaste.com/api/")
        .form(&params)
        .send()
        .unwrap();
    println!("{:?}", res.headers()["location"]);
}