473,799 Members | 3,350 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with WebRequest Authentication

Hello friends

I'm developing a app o send xml data to a web server using HTTP POST.To do
that Im using the WebRequest VB class. I can send the data sucessfully to the
web server, using:

Dim req As WebRequest
req =
WebRequest.Crea te("http://localhost/SendAndReceiveD ataWebPages/PassText.aspx")
req.Method = "POST"
Dim sw As New StreamWriter(re q.GetRequestStr eam())

sw.WriteLine("H ere goes te text to pass")
sw.Close()
rsp = req.GetResponse ()
......
....

but now I need to use Basic Authentication with username/password encoded on
my connection. Can anyone help me how can I do that, because I don't know how
can I do that.

Thank you for help
Bruno
Nov 21 '05 #1
1 1637
"Bruno" <Br***@discussi ons.microsoft.c om> schrieb:
I'm developing a app o send xml data to a web server using HTTP POST.To do
that Im using the WebRequest VB class. I can send the data sucessfully to
the
web server, using:

Dim req As WebRequest
req =
WebRequest.Crea te("http://localhost/SendAndReceiveD ataWebPages/PassText.aspx")
req.Method = "POST"
Dim sw As New StreamWriter(re q.GetRequestStr eam())

sw.WriteLine("H ere goes te text to pass")
sw.Close()
rsp = req.GetResponse ()
.....
...

but now I need to use Basic Authentication with username/password encoded
on
my connection.


Maybe you can use the techniques described here:

<URL:http://dotnet.mvps.org/dotnet/code/net/#CookieRequest>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

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

Similar topics

0
272
by: Dinesh Upare | last post by:
We are running in weird problem. We have web application1 and web application2 on same server and web application3 on other server. 1 and 2 has form based authentication and has been configured with site server. We are using WebRequest class from application1 to access pages of other applications(2 and 3).
1
5260
by: jadher | last post by:
I try to access an asp page in a machine that has windows integrated authentication turned on. I use System.Net.Networkcredentials as well as System.Net.Webrequest and Webresponse. I receive a response but when I try to use Response.Redirect(), a popup windows appears asking me for user, password, domain. Is there a way to pass the credentials to the Reponse.Redirect function so I
4
7236
by: Terry | last post by:
Hello, I am trying to get a response for an .aspx page in my current project (same virtual directory) by using WebRequest.GetResponse but I keep getting a exception with "500 Internal server error" in the exception message. I am able to do this fine with another .aspx page that has no code-behind. The page that has code-behind throws the exception. What I am doing is getting the .aspx response, reading the stream, replacing
0
1110
by: IronYuppie | last post by:
Hi all-- I'm retrieving contents from my site using the retrieving images from the database method listed here: http://www.aspfree.com/c/a/ASP.NET/Retrieving-Images-from-a-Database--C---Part-II/ Basically, the page just returns the image into the page (also within the same site) that's calling it.
0
1170
by: buran | last post by:
Dear ASP.NET Programmers, Please consider the intranet site with the following forms authentication page http://localhost/database/login.aspx. The usernames and passwords are stored in the SQL Server database. After authenticating, the users are be able to save the generated documents (HTML output of the generated document) when they click on a button in http://localhost/database/medicalDocs/1.aspx. I use the following code: Dim wReq...
3
4980
by: Greg Vereschagin | last post by:
I cannot get the following code to work when trying to download web pages through a proxy server: Dim wrq as Net.WebRequest Dim wrp as Net.WebResponse Dim proxyObject as WebProxy proxyObject = new WebProxy("abc-dc", 8080) proxyObject.BypassProxyOnLocal = True GlobalProxySelection.Select = proxyObject
2
6472
by: davidcbrown | last post by:
I started using .NET 2003 and my first application is to parse an HTML form. But I am behind an ISA firewall and get "(407) Proxy Authentication Required" with the following code. The proxy settings in webReq.Proxy appear to be OK, even without setting them as below. IE works, but this does not. Any ideas? (or where to ask?) -- David Dim webReq As WebRequest = WebRequest.Create(txtUrl.Text) webReq.Proxy = WebProxy.GetDefaultProxy Dim...
6
2475
by: Bob | last post by:
Hi, I am new to using a web resource which is not a webservice and I am spinning my wheels with the webrequest class. I am trying to interact with a URI that has been given to me. It is say www.bloggs.com/cgi-bin/thin-client" My app gathers data and is supposed to pass this data to the URI which will then respond with a result. So some real basic questions. 1)They have given me a user name and password to use.
5
3202
by: mcfly1204 | last post by:
I am attempting to use WebRequest to access a page that requires a login/password to access. My last WebRequest continues to timeout. Any help or thoughts would be appreciated. namespace FormsAuthTest { class Program { static void Main(string args) { HttpWebRequest request = null;
0
9688
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10490
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10238
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9077
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4145
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.