I will use the mediawiki API to edit page in my wiki.
First, with POST requets, I make : api.php?action=login&lgname=***&lgpassword=***&format=xml
I take the cookies and send, also in POST, : api.php?action=query&prop=info|revisions&intoken=edit&titles=Utilisateur:JonathanMM/Test_Trillian&format=xml
I have a token. I take this token and use the urlencode function in this token.
Then, I make : http://www.nocle.fr/nolife-wiki/api.php?action=edit&title=Utilisateur:JonathanMM/Test_Trillian&section=new&summary=Test+Trillian&bot=1&text=test&watch&token='.$token.'&format=xmlfm
But, I have this error :
<?xml version="1.0"?>
  <error code="badtoken" info="Invalid token" xml:space="preserve">

Where is the problem ?
Thank's for your help, and sorry for my English, but I'm french ;)