Neil Leathers via curl-users
2017-08-31 21:09:58 UTC
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
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