On Mon, 28 Oct 2019, ka sc via curl-library wrote:

 curl -XPOST localhost:4001/db/load -H "Content-type: text/plain"
--data-binary @"data/input.dump" --libcurl code.c

1. You don't want "-XPOST" when you use -d or a --data* flag. Remove it.

2. "--data-binary @"data/input.dump" is reading the file into a buffer and uses CURLOPT_POSTFIELDS to send it as a POST.

curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1);

This would make it use the read callback (or stdin) instead to get the data, which you of course can opt to do.

--

 / daniel.haxx.se | Get the best commercial curl support there is - from me
                  | Private help, bug fixes, support, ports, new features
                  | https://www.wolfssl.com/contact/
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Reply via email to