[][src]Function idcurl::post

pub fn post<'b, R: Read + 'b>(url: &str, r: R) -> Result<Response>

Sends an http POST request to the given URL.

The payload to send is read from r, which can be easily made with std::io::Cursor in case you're using a slice as a source.

let data = b"something to send";
idcurl::post("http://example.com", std::io::Cursor::new(data))
    .unwrap()
    .copy_to(&mut std::io::stdout())
    .unwrap();