/// Constructs a new `ClientBuilder`
Constructs a new `ClientBuilder`
Constructs a new ` ClientBuilder `
pub fn new() -> ClientBuilder {
        match TlsConnector::builder() {
            Ok(tls_connector_builder) => {
                let mut headers: HeaderMap<HeaderValue> = HeaderMap::with_capacity(2);
                headers.insert(USER_AGENT, HeaderValue::from_static(DEFAULT_USER_AGENT));
                headers.insert(ACCEPT, HeaderValue::from_str(mime::STAR_STAR.as_ref()).expect("unable to parse mime"));
                ClientBuilder {
                    config: Some(Config {
                        gzip: true,
                        headers: headers,
                        hostname_verification: true,
                        proxies: Vec::new(),
                        redirect_policy: RedirectPolicy::default(),
                        referer: true,
                        timeout: None,
                        tls: tls_connector_builder,
                        dns_threads: 4,
                    }),
                    err: None,
                }
            },
            Err(e) => ClientBuilder {
                config: None,
                err: Some(::error::from(e)),
            }
        }
    }
pub fn new ( ) -> ClientBuilder { match TlsConnector :: builder ( ) { Ok ( tls_connector_builder ) => { let mut headers : HeaderMap < HeaderValue > = HeaderMap :: with_capacity ( 2 ) ; headers . insert ( USER_AGENT , HeaderValue :: from_static ( DEFAULT_USER_AGENT ) ) ; headers . insert ( ACCEPT , HeaderValue :: from_str ( mime :: STAR_STAR . as_ref ( ) ) . expect ( " " ) ) ; ClientBuilder { config : Some ( Config { gzip : true , headers : headers , hostname_verification : true , proxies : Vec :: new ( ) , redirect_policy : RedirectPolicy :: default ( ) , referer : true , timeout : None , tls : tls_connector_builder , dns_threads : 4 , } ) , err : None , } } , Err ( e ) => ClientBuilder { config : None , err : Some ( :: error :: from ( e ) ) , } } }
Constructs a new `ClientBuilder`
Constructs a new ` ClientBuilder `