pub fn with_base_url(host: String, api_token: &str) -> Result<Self, Error> {
        let mut headers = header::HeaderMap::new();

        let mut auth_value = header::HeaderValue::from_str(&format!("Bearer {api_token}")).unwrap();
        // Consider marking security-sensitive headers with `set_sensitive`.
        auth_value.set_sensitive(true);
        headers.insert(header::AUTHORIZATION, auth_value);

        let http = ClientBuilder::new().default_headers(headers).build()?;

        Ok(Self { base: host, http })
    }
/// In production you typically would want set this to <https://api.aleph-alpha.com>. Yet you
/// may want to use a different instances for testing.
In production you typically would want set this to . Yet you
may want to use a different instances for testing.
In production you typically would want set this to . Yet you may want to use a different instances for testing .
pub fn with_base_url(host: String, api_token: &str) -> Result<Self, Error> {
        let mut headers = header::HeaderMap::new();
        let mut auth_value = header::HeaderValue::from_str(&format!("Bearer {api_token}")).unwrap();
        // Consider marking security-sensitive headers with `set_sensitive`.
        auth_value.set_sensitive(true);
        headers.insert(header::AUTHORIZATION, auth_value);
        let http = ClientBuilder::new().default_headers(headers).build()?;
        Ok(Self { base: host, http })
    }
pub fn with_base_url ( host : String , api_token : & str ) -> Result < Self , Error > { let mut headers = header :: HeaderMap :: new ( ) ; let mut auth_value = header :: HeaderValue :: from_str ( & format ! ( " " ) ) . unwrap ( ) ; // Consider marking security-sensitive headers with `set_sensitive`. auth_value . set_sensitive ( true ) ; headers . insert ( header :: AUTHORIZATION , auth_value ) ; let http = ClientBuilder :: new ( ) . default_headers ( headers ) . build ( ) ? ; Ok ( Self { base : host , http } ) }
In production you typically would want set this to <https://api.aleph-alpha.com>.
In production you typically would want set this to <https : // api . aleph - alpha . com > .
host
String
api_token
&str