Parsing gzipped xml feed help
Posted: Wed Dec 16, 2009 2:18 pm
I'm trying to deflate a gzipped (.gz) xml feed, the host of the feed requires that I: "set the header accept-encoding in request with value : gzip or gzip,deflate" I have a working xml parser but I can't get passed the .gz compression?
Here is my code below:
The response I get back from the host of the feed:
Here is my code below:
Code: Select all
<?php
header('Accept-Encoding: gzip,deflate');
$zp = gzopen("http://xml.url.com/xmlfeed/feed?", "r");
gzpassthru($zp);
?>
Code: Select all
<response>
<error-message>you must add 'accept-encoding' as 'gzip,deflate' to the header of your request</error-message>
</response>