post data using "WebRequest" or  "Net.WebRequest and redirect using asp.net/vb.net

ram27
ram27 used Ask the Experts™
on
Hi

  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 asp.net/vb.net 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)


Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2009
Commented:
Here's a few hints, but more importantly, download the WebRequest wrapper to make it easy for yourself: http://www.west-wind.com/weblog/posts/51891.aspx (link to wrapper on same page).

Here's full code (ignore the question about the 404, it is not relevant for you): http://stackoverflow.com/questions/768030/simple-httpwebrequest-over-ssl-https-gives-404-not-found-under-c

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