Mo, your question is not Watir-related as you have described it, so
you may have better luck using another Google group.  I have not
personally used the net/http method (I use Mechanize or Watir/
Webdriver).  Have you tried filling out the form and submitting it
using Watir?

Thanks,
Adam

On Aug 23, 11:06 am, Mohsen Qureshi <mohsen...@googlemail.com> wrote:
> Hi guys,
>
> I am wondering if anyone has any experience doing post requests. I am
> trying to automate a request without having much luck.....
>
> I have HTML page which simulates the post for me, however I don't want
> to include this. Its very simple and works, however trying to do this
> using Ruby is proving a little difficult.....
> Here is the HTML:
>
> <html><head>
> <meta http-equiv="content-type" content="text/html;
> charset=ISO-8859-1">
> </head><body><form name="input" action="https://www.examplesite.com";
> method="post">
> promotions code: <input name="promotions_code" value="XXXXX"
> type="text">
> <input name='button' value="Submit" type="submit">
> </form>
> </body></html>
>
> I am trying to simulate this using net/http, and have come up with the
> following code:
> Net::HTTP.post_form(URI.parse('https://www.examplesite.com'),
> {'promotions_code' => 'XXXXX', 'button' => 'Submit'})
>
> However I keep getting a BadResponse error. Im not too sure what the
> problem is here? Has anyone tried doing posts before, or can anyone
> see anything wrong with what I am doing?
>
> Thanks in advance
>
> Mo

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

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

Reply via email to