views:

154

answers:

1

Hello,

I use the API with HTTP POST to create a wiki page in a Mediawiki (1.14):

  1. I require an edit token
  2. It works, I get a fresh token (example: d96d72fae5e6c43b0b9f63d82ace366)
  3. I send the HTTP POST for creating a new site with my new token (sth. similar to "d96d72fae5e6c43b0b9f63d82ace366+\"
  4. 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?

+1  A: 

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
&section=new
&summary=Otters%3F
&text=Anyone%20see%20any%20otters%20lately%3F
&watch
&basetimestamp=2009-06-22T13:52:41ZZ
&token=d96d72fae5e6c43b0b9f63d82ace366%2B%5C
Otterfan