Page MenuHomePhabricator

Error message is unclear. "mustposttoken: The 'token' parameter must be POSTed"
Closed, ResolvedPublic

Description

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."


Version: 1.24rc
Severity: normal

Details

Reference
bz70656

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 3:48 AM
bzimport set Reference to bz70656.
bzimport added a subscriber: Unknown Object (MLST).
Halfak created this task.Sep 10 2014, 1:55 PM

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

Should be deployed to WMF wikis with 1.24wmf21, see https://www.mediawiki.org/wiki/MediaWiki_1.24/Roadmap for the schedule.