On 8/5/11 6:04 AM, Rahul Sharma wrote:
I have already tried Net::HTTP.post_form but I guess it only works for
forms that are on some page.
Rahul,

when a form is posted, the POST data in the request body contains only pairs of HTTP-encoded form fields: NAME=VALUE

That *might* be all you need. It does not matter much where the original page is located keeping in mind the following two caveats:

1. Your target page might or might not be checking HTTP_REFERRER value in the request's HTTP headers. HTTP_REFERRER contains the URL of the original page, and it should be easy to put it in when you assemble your request "manually" in your code.

2. Your browser session typically contains session and maybe even persistent cookies that keep track of (logged in) user session and get submitted with each request. If you capture cookies,
you can put them into your request.

I hope it helps.

--
DK
AIM: DKroot1, Skype: DKroot

--
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to