Skip to content

Instantly share code, notes, and snippets.

@clupasq
Created February 4, 2012 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clupasq/1736646 to your computer and use it in GitHub Desktop.
Save clupasq/1736646 to your computer and use it in GitHub Desktop.
get original URL from short URL (ex: bit.ly)
static string GetOriginalUrl(string shortUrl)
{
var httpRequest = (HttpWebRequest) WebRequest.Create(shortUrl);
httpRequest.Method = "HEAD";
using (var response = httpRequest.GetResponse())
return response.ResponseUri.AbsoluteUri;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment