javi bueno schreef:
Hi! I'm trying to get the edittoken using a POST call through the next code :
$URL="es.wikipedia.org/w/api.php"; $ch = curl_init( ); curl_setopt($ch, CURLOPT_URL,"http://$URL"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); $poststring["action"] = "query"; $poststring["prop"] = "info|revisions"; $poststring["intoken"] = "edit"; $poststring["titles"] = "Portada"; $data = curl_exec ($ch);
... but I always received the following response : edittoken="+"
anybody knows what's happening?
Since you haven't logged in (or, if you have, aren't passing the login cookies), you'll be treated as an anonymous users, whose edit token is always +\ .
Roan Kattouw (Catrope)