The remote server returned an error: (401) Unauthorized.

  • Thread starter Thread starter Santel
  • Start date Start date
S

Santel

Hi,

If I use the below code, I am receiving 'unauthorized' error in
DownloadData() method.

using (WebClient blockingClient = new WebClient())
{
byte[] atomBytes = blockingClient.DownloadData("http://
www.myserver.com/download/test.atom");

}

Can anyone please suggest! Do I have to do anything with server IIS
wrt atom file?
 
Santel said:
Hi,

If I use the below code, I am receiving 'unauthorized' error in
DownloadData() method.

using (WebClient blockingClient = new WebClient())
{
byte[] atomBytes = blockingClient.DownloadData("http://
www.myserver.com/download/test.atom");

}

Can anyone please suggest! Do I have to do anything with server IIS
wrt atom file?

Yes, you need to set the proper security credentials for IIS for the virtual
directory, which is most likely Anonymous.

MS.Public.inetserver.iis
 
Back
Top