cURL / Mailing Lists / curl-users / Single Mail


POST data from multiple files without "&" in between them

From: Jan Burger <>
Date: Fri, 20 Nov 2015 10:47:54 -0500

I'm really impressed with cURL and what it can do, but I'm struggling with
this feature:

-d, --data <data>

If any of these options is used more than once on the same command line,
the data pieces specified will be merged together with a separating
&-symbol. Thus, using '-d name=daniel -d skill=lousy' would generate a post
chunk that looks like 'name=daniel&skill=lousy'.

I'm trying to send a simple SOAP message with 1 element, the contents of a
text file, then I have two other files, header.txt and footer.txt (which is
the SOAP envelope), but the &-symbol in between the files messes things up:

curl --data @header.txt --data @OperationsData.txt --data @footer.txt "
--libcurl debug.txt

gives this back from the receiving end:

XercesHandler.FatalError: line 1, column 308, message unterminated entity

debug.txt has two offending &'s in CURLOPT_POSTFIELDS that I don't want.
Any way around this without changing the source code or writing a script
that concatenates the 3 files first?


List admin:
Received on 2015-11-20