J'essaye actuellement de modifier l'entête HTTP avec la librairie CURL pour recevoir des données bien structuré au format XML.
Mais je ne reçois pas de flux xml à part la réponse du serveur:
HTTP/1.1 100 Continue HTTP/1.1 200 OK Date: Sun, 15 Aug 2010 14:54:13 GMT Server: Apache Set-Cookie: PHPSESSID=e88ad4c2d0a0dbb9ceaee7ea79e12973; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Vary: Accept-Encoding Content-Length: 0 Connection: close Content-Type: text/html; charset=utf-8 http://uni19.ogame.fr/game/reg/login2.php
Voici mon code:
public function auth(){
curl_setopt($this->session, CURLOPT_HEADER , 1);
curl_setopt($this->session, CURLOPT_URL , $this->site);
curl_setopt($this->session, CURLOPT_POST , true);
curl_setopt($this->session, CURLOPT_POSTFIELDS , $this->identification);
curl_setopt($this->session, CURLOPT_COOKIEJAR , realpath('cookie.txt'));
curl_setopt($this->session, CURLOPT_COOKIESESSION , true);
curl_setopt($this->session, CURLOPT_FOLLOWLOCATION , true);
curl_setopt($this->session, CURLOPT_RETURNTRANSFER , true);
curl_setopt($this->session, CURLOPT_HTTPHEADER , Array("Content-Type:application/xml"));
}
Array("Content-Type:application/xml"));
Le content type est toujours text/html ... la modification de l'entête n'a rien donnée. Merci