Last modified: 2014-09-11 13:49:14 UTC
This error message happens when performing an edit via the API (action=edit). It means that the token parameter must appear in the *body* of a POST request. Surprisingly (to this dev), you can send a POST request with all of the data in the query string of the URL. FWIW, the API will not accept the 'token' param in the query string of a POST request. The current error message ("The 'token' parameter must be POSTed") suggest to me that the problem was that the request was not a POST requests (which it obviously was). I think that this message ought to be changed to make it clear that the problem was that the 'token' param did not appear in the *body* of the request. I propose: "The 'token' parameter must be in the POST body." Or perhaps more verbosely: "The 'token' parameter was found in the query string, but must be in the POST body."
Either one of those suggestions sounds good to me. I'd prefer the second one as being clearest. If you want to patch ApiMain.php, I'll +2. Otherwise I'll do it myself later.
Change 159653 had a related patch set uploaded by MZMcBride: Clarify "mustposttoken" API error message https://gerrit.wikimedia.org/r/159653
(In reply to Aaron Halfaker from comment #0) > Or perhaps more verbosely: > > "The 'token' parameter was found in the query string, but must be in the > POST body." Thank you for filing this bug. I dropped the period because it seemed more consistent for the file, but otherwise was fine with the verbose option.
Change 159653 merged by jenkins-bot: Clarify "mustposttoken" API error message https://gerrit.wikimedia.org/r/159653
Cheers. :)
Should be deployed to WMF wikis with 1.24wmf21, see https://www.mediawiki.org/wiki/MediaWiki_1.24/Roadmap for the schedule.