Fetching content from HTTPS using rustls (#2024)
* Fetching https * Fetching dispatcher (HTTP, HTTPS) * Fetching from github * Chunked encoding parser * Abort support * Fixing tests and review comments * Cargo.lock order [ci skip] * Relaxed -> SeqCst
This commit is contained in:
committed by
Arkadiy Paronyan
parent
c0b097832b
commit
59f18ab958
15
util/https-fetch/examples/fetch.rs
Normal file
15
util/https-fetch/examples/fetch.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
extern crate https_fetch;
|
||||
|
||||
use std::io;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::AtomicBool;
|
||||
use https_fetch::*;
|
||||
|
||||
fn main() {
|
||||
let client = Client::new().unwrap();
|
||||
let aborted = Arc::new(AtomicBool::new(false));
|
||||
|
||||
client.fetch(Url::new("github.com", 443, "/").unwrap(), Box::new(io::stdout()), aborted, |result| {
|
||||
assert!(result.is_ok());
|
||||
}).unwrap();
|
||||
}
|
||||
Reference in New Issue
Block a user