Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cURL Binary Data and Form Data

Tags:

curl

Is there any way to POST both binary data and form data using cURL? For example:

"C:\Program Files\Curl\curl" -k --data-binary @"C:\datafile.xml" -d "key=somethinghere" -H "Content-Type:application/html" -X POST http://localhost:57870/PostTheData -v

The binary data works just fine but I need to POST a parameter as well as the binary data.

Any ideas?

like image 536
Kezzer Avatar asked Nov 04 '22 08:11

Kezzer


1 Answers

Always speaking too soon. I've fixed this now:

"C:\Program Files\Curl\curl" -k -d "param=something" --data-binary @"data.xml" http://localhost:57870/UploadData -v

Hey presto.

like image 193
Kezzer Avatar answered Nov 16 '22 10:11

Kezzer