curl / Mailing Lists / curl-users / Single Mail


Re: per-file additional headers from CLI (for multipart POST, SOAP, etc.)

From: Dan Fandrich <>
Date: Mon, 6 Mar 2017 23:33:27 +0100

On Tue, Mar 07, 2017 at 12:01:20AM +0300, wrote:
> Dear Programmers,
> I need help with CURL:
> In short, i need to add some custom headers, different for each file in same
> request, using Command-line interface only.
> Full text of my task is here:
> I post it about a month ago, but still no luck.
> I very welcome answers at both here or at Stackoverflow.

That link isn't working for me, but I'm guessing you're not looking for the -H
option. If you want custom headers in each multipart/form-data section you can
do that with the CURLFORM_CONTENTHEADER option to curl_formadd(), but that's not
exposed by the command-line tool. You would need to generate the multipart
form body yourself and send it as a raw POST body, which isn't very convenient.

>>> Dan
Received on 2017-03-06