cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Wuery regarding "CURLOPT_FOLLOWLOCATION" option of libCurl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 21 Aug 2014 16:48:01 +0200 (CEST)

On Thu, 21 Aug 2014, Arif Ali Saiyed wrote:

> I foudn out that there is some option like "CURLOPT_FOLLOWLOCATION" but when
> I use it. curl only gets the responseHeader alone from redirected location
> and not the responsebody.

That's not correct. libcurl will provide the body for the followed-to
response. You can test this very easily with curl and its -L option.

I can't tell why it doesn't work for you.

> "If you want the full bodies, don't ask libcurl to follow the redirects but
> handle that yourself."
>
> Here it looks contradictory to my previous understanding of "when you set
> CURLOPT_FOLLOWLOCATION"

That line could probably be expanded somewhat to say

If you want the full response bodies of *all* responses, including the 3xx
ones that libcurl will follow location: from when you have
CURLOPT_FOLLOWLOCATION enabled, you should do the redirect handling yourself.

> What is this option "CURLOPT_REDIRBODIES" thats being talked about in some
> places. I htink I have the latest version of libCurl. But this option is not
> there.

It was a suggested option back in 2005 that never went anywhere:
http://curl.haxx.se/mail/lib-2005-07/0195.html

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-08-21