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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top