How to get status_code and primary_ip data from the transfer function? currently working code, want to increase data of getting status_code and primary_ip, but prompt transfer function error
code:
let mut dst = Vec::new();
let mut c = Easy::new();
c.url(&domain);
c.certinfo(true).ok().expect("Show cert Error!");
c.show_header(true).ok().expect("Show Header Error!");
c.timeout(Duration::new(60, 0));
{
let mut t = c.transfer();
t.write_function(|data| {
dst.extend_from_slice(data);
Ok(data.len())
}).unwrap();
match t.perform() {
Ok(_) => {},
Err(_) => {}
}
}
Error Message:
error[E0599]: no method named primary_ip found for type curl::easy::Transfer<'_, '_> in the current scope
Thanks for the report! Typically after performing a transfer you'll return to the outer scope and read properties off the original Easy handle. Only some properties (mostly callbacks) are offered on Transfer
How to get status_code and primary_ip data from the transfer function? currently working code, want to increase data of getting status_code and primary_ip, but prompt transfer function error code:
Error Message: error[E0599]: no method named
primary_ip
found for typecurl::easy::Transfer<'_, '_>
in the current scope