cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: how can i recognize http head or body?

From: Lijo Antony <lta_at_one.com>
Date: Thu, 08 Nov 2012 17:32:31 +0400

On 11/08/2012 05:14 PM, huancong deng wrote:
> the code is here:
> -------------------------------
> curl_easy_setopt(curl,
> CURLOPT_URL,"http://ucenter.local.ucloud.cn/api/aiotest/test");
> curl_easy_setopt(curl, CURLOPT_READDATA, fd);
> curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
> curl_easy_setopt(curl,
> CURLOPT_INFILESIZE_LARGE, (curl_off_t)file_info.st_size);
> curl_easy_setopt(curl, CURLOPT_HEADER,1L);
> curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &common_http_write_cb);
> ===================================================
>
> it return two http head, one is 100, the other is 200, how can
> i distinguish which is head and which is body ? is there any api or
> option can tell me "you are getting the head " in my writefunction
> "ommon_http_write_cb" ?

http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTHEADERFUNCTION

> thanks a lot, :)
>
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-11-08