Im getting a "(401) Unauthorized" error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to use the Webclient class to "POST" to a web site. The website
is using basic authentication. Im getting a "(401) Unauthorized" error.
Here is my basic code:

dim myWebClient as WebClient = New WebClient
myWebClient.Credentials = New NetworkCredential("user", "pass")
bytReturn = myWebClient.UploadData(strURL, bytRequest)

I know the user/pass is correct because I can log on manually to the website.
 
perhaps "domain\username" or "machinename\username" instead of just
"username"? just guessing...

Also, you should see something in the Event Log.

Jeff
CLEAR-RCIC said:
I'm trying to use the Webclient class to "POST" to a web site. The website
is using basic authentication. Im getting a "(401) Unauthorized" error.
Here is my basic code:

dim myWebClient as WebClient = New WebClient
myWebClient.Credentials = New NetworkCredential("user", "pass")
bytReturn = myWebClient.UploadData(strURL, bytRequest)

I know the user/pass is correct because I can log on manually to the
website.
 
Back
Top