cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Couldn't receive the body of the requested URL

From: Michael Wood <esiotrot_at_gmail.com>
Date: Tue, 2 Feb 2010 15:02:21 +0200

On 2 February 2010 14:46, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Tue, 2 Feb 2010, debojyoti.pal_at_wipro.com wrote:
>
>> I have written a very small program, which initialize a curl handle, set
>> the URL http://tube.com/sports and then call curl_easy_perform() method. But
>> in return it displays only the header part, but for body it is telling that
>> "document has moved ....". But when I give the same URL to command line tool
>> curl, it is giving all the body along with header.
>
> That makes me suspect the server is acting differently due to differences in
> the requests. For example, libcurl sends no user-agent field by default.

Indeed, the following prints the body:

curl http://tube.com/sports

while this does not:

curl -H "User-Agent:" http://tube.com/sports

-- 
Michael Wood <esiotrot_at_gmail.com>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-02-02