I'm getting 401 while trying to make an API call via my web API in C#.
When I paste the exact same URL in my browser it works.
Does anyone know why?
Thanks!
Welcome to the Q&A Forum
Browse the forum for helpful insights and fresh discussions about all things SEO.
I'm getting 401 while trying to make an API call via my web API in C#.
When I paste the exact same URL in my browser it works.
Does anyone know why?
Thanks!
Hi Lisa,
Thanks! Though the problem is not with the app itself because if I switch the URL from the API one so some other random URLs, it works fine.
I'm using it as such:
chkStr = "https://lsapi.seomoz.com/linkscape/url-metrics/" + domainUrl + "?Cols=68719476736&Limit=10&" + authenticationStr;
using (WebClient client = new WebClient())
{
string htmlCode = client.DownloadString(chkStr);
string[] temp1 = htmlCode.Split(":");
string[] temp2 = temp1[1].Split("}");
int da = int.Parse(temp2[0]);
return da;
}
Obviously the call to DownloadString throws this exception.