Last modified: 2014-09-11 13:49:14 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T72656, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70656 - Error message is unclear. "mustposttoken: The 'token' parameter must be POSTed"
Error message is unclear. "mustposttoken: The 'token' parameter must be POSTed"
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.24rc
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-10 13:55 UTC by Aaron Halfaker
Modified: 2014-09-11 13:49 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Aaron Halfaker 2014-09-10 13:55:49 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."
Comment 1 Brad Jorsch 2014-09-10 13:58:17 UTC
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.
Comment 2 Gerrit Notification Bot 2014-09-11 01:24:50 UTC
Change 159653 had a related patch set uploaded by MZMcBride:
Clarify "mustposttoken" API error message

https://gerrit.wikimedia.org/r/159653
Comment 3 MZMcBride 2014-09-11 01:26:16 UTC
(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.
Comment 4 Gerrit Notification Bot 2014-09-11 01:39:50 UTC
Change 159653 merged by jenkins-bot:
Clarify "mustposttoken" API error message

https://gerrit.wikimedia.org/r/159653
Comment 5 Aaron Halfaker 2014-09-11 13:34:31 UTC
Cheers.  :)
Comment 6 Brad Jorsch 2014-09-11 13:49:14 UTC
Should be deployed to WMF wikis with 1.24wmf21, see https://www.mediawiki.org/wiki/MediaWiki_1.24/Roadmap for the schedule.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links