I tried this on my own box, and it worked for me:
roan@roanLaptop:~/mediawiki$ wget http://en.wikipedia.org/w/api.php '--post-data=action=login&lgname=Catrope&lgpassword=Whee&format=xml'
roan@roanLaptop:~/mediawiki$ cat api.php <?xml version="1.0"?><api><login result="WrongPass" /></api>roan@roanLaptop:~/mediawiki$
roan@roanLaptop:~/mediawiki$ wget http://en.wikipedia.org/w/api.php '--post-data=action=login&lgname=Catrope&lgpassword=myrealpassword&format=xml'
roan@roanLaptop:~/mediawiki$ cat api.php <?xml version="1.0"?><api><login result="Success" lguserid="4587601" lgusername="Catrope" lgtoken="01d2a06cc88aaac0e302b6919838da56" cookieprefix="enwiki" sessionid="8db0e034f8eca59183d604ba34fd96fa" /></api>roan@roanLaptop:~/mediawiki$
Roan Kattouw (Catrope)