curl-users
Re: HTML Form POST thru JavaScript OnClick problem
Date: Fri, 13 Jul 2012 22:48:33 +0200
On Fri, Jul 13, 2012 at 01:37:08PM -0700, Charles Wallace wrote:
> I'm trying to POST thru curl, to a web form which also uses javascript.
> I can not figure out the proper syntax, and am looking for help.
> This is an embedded chipset, and uses HTTP 1.0
>
> The webpage resides at http://10.0.12.2/generic.htm
>
> I want to issue the Generic command "06984631", which works fine from the
> web page itself.
>
> I have tried several variations to my curl command, such as:
>
> curl -0 --trace-ascii debugdump.txt --data "generictext=06984131"
> http://10.0.12.2/generic.htm
It's unlikely that the POST target URL is the same as the form URL. The
example HTML you gave doesn't show an ACTION attribute, so it's probably
being added dynamically, or otherwise dealt with in JavaScript. You'll
have to either look at what the code is doing manually, or just capture
the output of a web browser when it interprets the code and emulate that.
>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-07-13