Help with WebRequest Authentication

G

Guest

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.Create("http://localhost/SendAndReceiveDataWebPages/PassText.aspx")
req.Method = "POST"
Dim sw As New StreamWriter(req.GetRequestStream())

sw.WriteLine("Here 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
 
H

Herfried K. Wagner [MVP]

Bruno said:
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.Create("http://localhost/SendAndReceiveDataWebPages/PassText.aspx")
req.Method = "POST"
Dim sw As New StreamWriter(req.GetRequestStream())

sw.WriteLine("Here 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>
 

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