cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: cURL on Windows Xp: "Content-Length Header required" error

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 12 Jan 2009 19:51:00 +0100 (CET)

On Mon, 12 Jan 2009, Tanmay Anjaria wrote:

> *I need to post a number of things before the actual binary data file.*

You're referring to the set of custom headers then? CURLOPT_HTTPHEADER lets
you add any set you desire.

> Now, my question is *how to send all these using HTTP POST*? I'm looking
> into CURLOPT_HTTPPOST, but through that u can only send one post at a time
> and that too only of an HTTP header.

With CURLOPT_POSTFIELDS, or CURLOPT_POST and a read callback set, you provide
the request _body_ for the POST. That does not include any request headers.

(And please don't top-post...)

-- 
  Daniel
Received on 2009-01-12