post data using "WebRequest" or  "Net.WebRequest and redirect using

ram27 used Ask the Experts™

  I want to use "WebRequest" or  "Net.WebRequest" to create and  send post data to https website and redirect to https website.
How is it possible using 3.5 framework.

i wan to try some thing like this,
 Dim hwrRequest = Net.WebRequest.Create(strPostUrl)
                hwrRequest.ContentType = "application/x-www-form-urlencoded"
                hwrRequest.Method = "POST"
i am not sure above approach is proper not not.
Also let me know how to redirect the response stream(https site)

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2009
Here's a few hints, but more importantly, download the WebRequest wrapper to make it easy for yourself: (link to wrapper on same page).

Here's full code (ignore the question about the 404, it is not relevant for you):

The redirect can be done based on the returned data. See the wrapper.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial