Using HttpWebRequest

  • Thread starter Thread starter Roger R. Smith
  • Start date Start date
R

Roger R. Smith

I would like to take some data off an ASP.NET form and then use that data to
post a new form to another web site. I was going to use:
HttpWebRequest, but I want to be able to post the form and follow the form
submission.
Any ideas?
Thanks,
Rog
 
Roger,

You can definitely do this. What you hav to do is create your
HttpWebRequest for the url that you want to post to. Then, set the Method
property to "POST". Finally, all you have to do is get the request stream
(through the GetRequestStream method), and write the posted values to the
stream. When done, you can call GetResponse to get the associated response.

Hope this helps.
 
If I try to use paypal for instance from my site and I collect some
information on an ASP.NET web form and then I want to do some processing
before I forward onto paypal. I then went to put the relevant information
into a form and submti that form to paypal and have the page redirect to to
the paypal page with the data that was just submitted in the form.
I want to use a form submission rather than a get to prevent users from
changing the parms in the request url.
Thank you so much for replying!!!
Rog


Nicholas Paldino said:
Roger,

You can definitely do this. What you hav to do is create your
HttpWebRequest for the url that you want to post to. Then, set the Method
property to "POST". Finally, all you have to do is get the request stream
(through the GetRequestStream method), and write the posted values to the
stream. When done, you can call GetResponse to get the associated response.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Roger R. Smith said:
I would like to take some data off an ASP.NET form and then use that
data
to
post a new form to another web site. I was going to use:
HttpWebRequest, but I want to be able to post the form and follow the form
submission.
Any ideas?
Thanks,
Rog
 
Roger,

If your next posting is about how to send out emails (while masking the
sender to make it look like you are from paypal), I'm going to hunt you down
=)

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Roger R. Smith said:
If I try to use paypal for instance from my site and I collect some
information on an ASP.NET web form and then I want to do some processing
before I forward onto paypal. I then went to put the relevant information
into a form and submti that form to paypal and have the page redirect to to
the paypal page with the data that was just submitted in the form.
I want to use a form submission rather than a get to prevent users from
changing the parms in the request url.
Thank you so much for replying!!!
Rog


message news:[email protected]...
Roger,

You can definitely do this. What you hav to do is create your
HttpWebRequest for the url that you want to post to. Then, set the Method
property to "POST". Finally, all you have to do is get the request stream
(through the GetRequestStream method), and write the posted values to the
stream. When done, you can call GetResponse to get the associated response.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Roger R. Smith said:
I would like to take some data off an ASP.NET form and then use that
data
to
post a new form to another web site. I was going to use:
HttpWebRequest, but I want to be able to post the form and follow the form
submission.
Any ideas?
Thanks,
Rog
 
Back
Top