public IsGd(string url) { Validation.IsUrl(url, Message.MessageUrlIsInvalid); Url = new Uri(url); Client = WebClientFactory.Create(); Address = string.Format(address, url); Provider = new Provider("is.gd", new Uri("http://is.gd/")); }
public MigreMe(string url) { Validation.IsUrl(url, Message.MessageUrlIsInvalid); Url = new Uri(url); Client = WebClientFactory.Create(); Address = string.Format(address, url); Provider = new Provider("migre.me", new Uri("http://migre.me/")); }
public TinyUrl(string url) { Validation.IsUrl(url, Message.MessageUrlIsInvalid); Url = new Uri(url); Client = WebClientFactory.Create(); Address = string.Format(address, url); Provider = new Provider("tinyurl", new Uri("http://tinyurl.com")); }
private void loadVariable(string key, string url) { Url = new Uri(url, UriKind.RelativeOrAbsolute); Key = key; WebHeaderCollection Headers = new WebHeaderCollection(); Headers.Add(HttpRequestHeader.ContentType, "application/json"); Headers.Add("x-api-key", Key); Client = WebClientFactory.Create(Headers); Address = address; Provider = new Provider("tr.im", new Uri("https://tr.im/")); }
public Bitly(string token, string url) { Validation.IsNotNull(token, Message.MessageKeyIsEmpty); Validation.IsUrl(url, Message.MessageUrlIsInvalid); Url = new Uri(url); Token = token; WebHeaderCollection Headers = new WebHeaderCollection(); Headers.Add("token", token); Client = WebClientFactory.Create(Headers); Address = string.Format(address, token, url); Provider = new Provider("bitly", new Uri("https://bitly.com/")); }
public Googl(string key, string url) { Validation.IsUrl(url, Message.MessageUrlIsInvalid); Validation.IsNullOrEmpty(key, Message.MessageKeyIsEmpty); Send = new ShortUrlSendGoogl(url); Url = new Uri(url, UriKind.RelativeOrAbsolute); ApiKey = key; WebHeaderCollection Headers = new WebHeaderCollection(); Headers.Add(HttpRequestHeader.ContentType, "application/json"); Headers.Add("key", ApiKey); Client = WebClientFactory.Create(Headers); Address = string.Format(address, ApiKey); Provider = new Provider("goo.gl", new Uri("https://www.googleapis.com/")); }