Bonjour,
Je cherche à récupérer le flux à l'adresse suivante : http://umespe.com/index.php?page=newsrss&type=1
Pour cela, voici mon code :
Lorsque j'affiche dans mon navigateur le flux, celui est correct et chargé en 0.5s.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 $timestamp = time(); $opts = array( 'http'=> array( 'method' => "GET" ) ); $context = stream_context_create($opts); $xml = file_get_contents("http://umespe.com/index.php?page=newsrss&type=1", false, $context); echo time() - $timestamp; // Temps d'exécution echo "<hr />"; foreach($http_response_header as $header) { echo $header, "<br />"; } echo "<hr />"; echo htmlentities($xml, ENT_COMPAT, "UTF-8");
Lorsque j'affiche mon flux appelé depuis le script, j'ai une chaîne avant l'en-tête XML et un 0 à la fin du flux m'empêchant d'analyser le flux. Le flux met 15s à se charger.
Je m'arrache les cheveux à essayer de comprendre d'où cela provient.HTTP/1.1 200 OK
Date: Tue, 11 May 2010 15:38:22 GMT
Server: Apache/2.2.11 (Debian) PHP/5.2.11-2 with Suhosin-Patch
X-Powered-By: PHP/5.2.11-2
Status: 200 OK
Transfer-Encoding: chunked
Content-Type: application/xml; charset=utf-8







Répondre avec citation
Partager