I have this-

en.wikipedia.org/w/api.php?action=login&lgname=user&lgpassword=password

But it doesn't work because it is a get request.  What would the the post request version of this?
Cheers!
Since your sample is in PHP, use $_REQUEST, this holds the contents of both $_GET and $_POST.
Changing a get request to a post in python?