curl / Mailing Lists / curl-users / Single Mail

curl-users

post data syntax confusion

From: Neil Leathers via curl-users <curl-users_at_cool.haxx.se>
Date: Thu, 31 Aug 2017 17:09:58 -0400

I am trying to test an existing call for a third party callback. I am
having difficulty with the syntax.

curl -d mandrill_events=@filename -X POST http://api.cool.haxx.se

Instead of the contents of the file being sent, the value "@filename" is
being sent. Similarly, using "mandrill_events=@-" and "mandrill_events=-"
with a redirect both fail. Using -F is not acceptable since it doesn't
match the format used by the third party. What is the correct syntax for
uploading a file as a named parameter using a --data variant?

(For reference: Centos 7
$ curl -V
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.21 Basic ECC
zlib/1.2.7 libidn/1.28 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3
pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz
unix-sockets
)

Neil

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-08-31