cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Question about Content-type: multipart

From: Waitman Gobble <gobble.wa_at_gmail.com>
Date: Mon, 7 Mar 2016 01:10:40 -0800

On Mon, Mar 7, 2016 at 12:53 AM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Mon, 7 Mar 2016, Waitman Gobble wrote:
>
>> Sorry, original post doesn't show but i did add it in
>> long post_size;
>> post_size = ftell(fp);
>>
>> curl_easy_setopt(conn, CURLOPT_POSTFIELDSIZE, post_size);
>
>
> But you overrode that value yourself in the request:
>
>> std::string cl = "Content-Length: " + std::to_string(post_size);
>> chunk = curl_slist_append(chunk, cl.c_str());
>> curl_easy_setopt(conn, CURLOPT_HTTPHEADER, chunk);
>
>
> ... so if there's a wrong Content-Length: in the request, you put it there.
> Didn't you?
>
>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: https://cool.haxx.se/list/listinfo/curl-library
> Etiquette: https://curl.haxx.se/mail/etiquette.html

I've tried with and without Content-Length header.
Without adding the header it was sending 172 bytes, which I believe is
due to strlen()

Thank you,

-- 
Waitman Gobble
Los Altos California USA
650-900-8557
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html
Received on 2016-03-07