cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: follow redirect for wikipedia?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 8 Sep 2010 23:08:22 +0200 (CEST)

On Wed, 8 Sep 2010, whimsica_at_aol.com wrote:

> When I do this it ends up giving me back some binary code.

Because wikipedia.org is not being nice. They provide the data with
"Content-Encoding: gzip" meaning the data is compressed - without the client
asking for it - so it needs to be uncompressed!!

> Any suggestions on options for dealing with a redirect like this?

(Those links aren't redirects at all.)

You should enable libcurl's automatic decompression by using the
CURLOPT_ENCODING option.

-- 
  / daniel.haxx.se
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2010-09-08