Help with WebRequest Authentication

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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>
 
Back
Top