Mediawiki: Invalid Edit Token
Question
I use the API with HTTP POST to create a wiki page in a Mediawiki (1.14):
- I require an edit token
- It works, I get a fresh token (example: d96d72fae5e6c43b0b9f63d82ace366)
- I send the HTTP POST for creating a new site with my new token (sth. similar to "d96d72fae5e6c43b0b9f63d82ace366+\"
- I get an error message "Invalid Token"
I don't understand why I get this message, because I send a freshly created token in my POST request.
Any idea?
Solution
Did you URL-encode the terminating characters of your token? You have to convert the +\
to %2B%5C
. Your POST request should look something like (minus the line breaks):
action=edit&title=Talk:River%20Otters
§ion=new
&summary=Otters%3F
&text=Anyone%20see%20any%20otters%20lately%3F
&watch
&basetimestamp=2009-06-22T13:52:41ZZ
&token=d96d72fae5e6c43b0b9f63d82ace366%2B%5C
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow