-
Notifications
You must be signed in to change notification settings - Fork 247
Open
Description
use curl::easy::Easy;
// Capture output into a local `Vec`.
fn main() {
let mut dst = Vec::new();
let mut easy = Easy::new();
easy.url("https://www.rust-lang.org/").unwrap();
let mut transfer = easy.transfer();
transfer.write_function(|data| {
dst.extend_from_slice(data);
Ok(data.len())
}).unwrap();
transfer.perform().unwrap();
println!("{:?}", dst);
}
ive added that last println! line as a basic way to show theres no way to access the data after its written to, unless im missing something fundamental about closures
Metadata
Metadata
Assignees
Labels
No labels