You could just look up the post-parameters you need.
Url: https://www.google.com/accounts/ServiceLoginAuth
The source for the login-form of gmail:
<form id="gaia_universallogin"
action="https://www.google.com/accounts/ServiceLoginAuth" method="post"
onsubmit="return(gaia_onLoginSubmit());">
<input type="hidden" name="continue" id="continue"
value="https://mail.google.com/mail/?ui=html&amp;zy=l" />
<input type="hidden" name="service" id="service"
value="mail" />
<input type="hidden" name="rm" id="rm"
value="false" />
<input type="hidden" name="dsh" id="dsh"
value="-4518095010699607103" />
<input type="hidden" name="ltmpl" id="ltmpl"
value="default" />
<input type="hidden" name="hl" id="hl"
value="en" />
<input type="hidden" name="ltmpl" id="ltmpl"
value="default" />
<input type="hidden" name="scc" id="scc"
value="1" />
<input type="hidden" name="ss" id="ss"
value="1" />
<input type="hidden" name="ltmpl" id="ltmpl"
value="default" />
<input type="hidden" name="ltmplcache" id="ltmplcache"
value="2" />
</form>