It is best to use something like Firebug or Live HTTP Headers (both for Firefox) to actually try to click a button and see what happens as a result of the request. Then try to repeat it.
Here is a simple example:
website form:
<form action="http://someUrl.com/somePage.html" method="POST"> <input type="text" name="value1"> <br /> <input type="text" name="value2"> <br /> <input type="submit"> </form>
In the first field, enter "Some value number one", typing "Second value number two" in the second field and clicking the "Send" button, you will receive a request that looks something like
POST /somePage.html HTTP/1.1 Host: someUrl.com ...//various other POST headers here Content-Type: application/x-www-form-urlencoded Content-Length: 57 value1=Some+value+number+one&value2=Some+value+number+two
which translates to cUrl command, for example
curl -d "value1=Some%20value%20number%20one&value2=Some%20value%20number%20two" http://someUrl.com/somePage.html
source share