Thanks Brad. Content length is probably the problem. If I were sending content say like:
format=xml&action=login&lgname=mybot&lgpassword=pwd[some trailing spaces]
and the Content-Length: included some of those trailing spaces, would the spaces be
considered part of the passwd?
Kracekumar Ramaraju else asked about the programming language - it's code generated
from Talend Open Studio. I didn't bother specifying a User-Agent since I'd only
use it against my personal wiki.
--- On Fri, 1/25/13, Brad Jorsch <bjorsch(a)wikimedia.org> wrote:
From: Brad Jorsch <bjorsch(a)wikimedia.org>
Subject: Re: [Mediawiki-api] Can't login to MW 1.71 - "WrongToken"
To: "MediaWiki API announcements & discussion"
Date: Friday, January 25, 2013, 8:36 AM
On Thu, Jan 24, 2013 at 10:54 PM,
I'm trying to use the API in Mediawiki 1.17.
You should probably upgrade.
The length of the post data you have here is 51 bytes. Your
username and password together must be 8 bytes longer than
The length of the post data you have here is 92 bytes. You
bytes, which is consistent with the length of the
"&lgtoken=0e8287f8976207131b153ca2acf25cfb" string that
was added to
the post data. But you only added 40 to the Content-Length
the server is probably seeing
"&lgtoken=0e8287f8976207131b153ca2acf25cf", with the
last character is
It's good practice to use a custom user agent for your bot,
an email address or URL to a webpage with a way to contact
instead of something generic like this. On
not matter, but if you ever decide to use your bot on a WMF
custom User-Agent is required.
Mediawiki-api mailing list