Im getting a "(401) Unauthorized" error

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.
 
J

Jeff Dillon

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.
 

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

Top