curl / Mailing Lists / curl-users / Single Mail


Re: post data syntax confusion

From: Daniel Stenberg <>
Date: Thu, 31 Aug 2017 23:20:00 +0200 (CEST)

On Thu, 31 Aug 2017, Neil Leathers via curl-users wrote:

> 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

1. Remove "-X POST", that's just superfluous at best
2. You'll probably like to use:

  curl --data-urlencode mandrill_events@filename

> What is the correct syntax for uploading a file as a named parameter using a
> --data variant?

--data only supportx @file and then you need to format that file correctly.

--data-urlencode supports the version I show above, but then it also URL
encodes the contents read from the file.

Received on 2017-08-31