pub fn new(
		base_url: &str,
		apisecret: Option<String>,
		tor_config_dir: Option<String>,
		socks_running: bool,
	) -> Result<HttpDataSender, Error> {
		if !base_url.starts_with("http") && !base_url.starts_with("https") {
			Err(ErrorKind::GenericError(format!("Invalid http url: {}", base_url)).into())
		} else {
			Ok(HttpDataSender {
				base_url: base_url.to_owned(),
				apisecret,
				use_socks: false,
				socks_proxy_addr: None,
				tor_config_dir: tor_config_dir.unwrap_or(String::from("")),
				socks_running: socks_running,
			})
		}
	}
/// Create, return Err if scheme is not "http"
Create, return Err if scheme is not "http"
Create return Err if scheme is not " http "
pub fn new(
		base_url: &str,
		apisecret: Option<String>,
		tor_config_dir: Option<String>,
		socks_running: bool,
	) -> Result<HttpDataSender, Error> {
		if !base_url.starts_with("http") && !base_url.starts_with("https") {
			Err(ErrorKind::GenericError(format!("Invalid http url: {}", base_url)).into())
		} else {
			Ok(HttpDataSender {
				base_url: base_url.to_owned(),
				apisecret,
				use_socks: false,
				socks_proxy_addr: None,
				tor_config_dir: tor_config_dir.unwrap_or(String::from("")),
				socks_running: socks_running,
			})
		}
	}
pub fn new ( base_url : & str , apisecret : Option < String > , tor_config_dir : Option < String > , socks_running : bool , ) -> Result < HttpDataSender , Error > { if ! base_url . starts_with ( " " ) && ! base_url . starts_with ( " " ) { Err ( ErrorKind :: GenericError ( format ! ( " " base_url ) ) . into ( ) ) } else { Ok ( HttpDataSender { base_url : base_url . to_owned ( ) , apisecret , use_socks : false , socks_proxy_addr : None , tor_config_dir : tor_config_dir . unwrap_or ( String :: from ( " " ) ) , socks_running : socks_running , } ) } }
Create, return Err if scheme is not "http"
Create return Err if scheme is not " http "
base_url
&str
apisecret
Option<String>
tor_config_dir
Option<String>
socks_running
bool
base_url
&str
apisecret
Option<String>
tor_config_dir
Option<String>
socks_running
bool