473,396 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Im getting a "(401) Unauthorized" error

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.
Nov 22 '05 #1
1 1771
perhaps "domain\username" or "machinename\username" instead of just
"username"? just guessing...

Also, you should see something in the Event Log.

Jeff
"CLEAR-RCIC" <CL*******@discussions.microsoft.com> wrote in message
news:FF**********************************@microsof t.com...
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.
Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: CLEAR-RCIC | last post by:
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...
1
by: ag | last post by:
Hi guys.. need your help. We have abc.asp page on the source server which calls a .net component on that server. The component is in MTS running under say "domain2\id1" identity. The component...
4
by: Sanjay | last post by:
I have written a web service to return information from the database. This works and the data is returned in XML format from the database and displayed on the web page as well when this web service...
1
by: twnety0ne | last post by:
Hey guys, I am trying to connect to my webite(hosted on a different server) and get some data from a page, but I am getting the 401 (Unauthorized) error. I tried different things like sending...
0
by: Kyle Baley | last post by:
I'm developing an MCMS web service and am getting a 401 unauthorized error when I try to consume it from a client. It works fine when I use the test harness to navigate to the asmx file directly....
0
by: Daatmor | last post by:
Hi, I've worte a program that will grab the html file content from web server. It's work ...
0
by: Shree | last post by:
While invoking the web service from client, I am setting the credentitals using the following code... ReportingService.Credentials = System.Net.CredentialCache.DefaultCredentials; But in...
0
by: =?Utf-8?B?R2VvcmdlIFNodWk=?= | last post by:
I have a folder structure such like this. A ---A1 -----a1.aspx ---A2 A1 and A2 are the subfolder of A. And under the A1 folder, it contains one aspx file named a1.aspx. I set the IIS virtual...
0
by: RSH | last post by:
Hi, I am trying to access a reporting services report using the HTTPWebRequest object but I am getting an error: The remote server returned an error: (401) Unauthorized. We can't seem to figure...
11
by: jjw92 | last post by:
I've been banging my head against the wall with this one for a couple days so I'm hoping someone has some ideas. I have a web service that I created that is called by a .NET class library (which in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.