Not enough reputation to comment so leave this as an answer hoping it help.
curl -L -v --post301 --post302 -i -X PUT -T "${aclfile}" \
-H "Date: ${dateValue}" \
-H "Content-Type: ${contentType}" \
-H "Authorization: AWS ${s3Key}:${signature}" \
${host}:${port}${resource}
This is what I used for a S3 bucket acl put operation. Headers are in -H and body which is a xml file is in ${aclfile} following -T. You can see that from the output:
/aaa/?acl
* About to connect() to 192.168.57.101 port 80 (#0)
* Trying 192.168.57.101...
* Connected to 192.168.57.101 (192.168.57.101) port 80 (#0)
> PUT /aaa/?acl HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 192.168.57.101
> Accept: */*
> Date: Thu, 18 Aug 2016 08:01:44 GMT
> Content-Type: application/x-www-form-urlencoded; charset=utf-8
> Authorization: AWS WFBZ1S6SO0DZHW2LRM6U:r84lr/lPO0JCpfk5M3GRJfHdUgQ=
> Content-Length: 323
> Expect: 100-continue
>
< HTTP/1.1 100 CONTINUE
HTTP/1.1 100 CONTINUE
* We are completely uploaded and fine
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< x-amz-request-id: tx00000000000000000001f-0057b56b69-31d42-default
x-amz-request-id: tx00000000000000000001f-0057b56b69-31d42-default
< Content-Type: application/xml
Content-Type: application/xml
< Content-Length: 0
Content-Length: 0
< Date: Thu, 18 Aug 2016 08:01:45 GMT
Date: Thu, 18 Aug 2016 08:01:45 GMT
<
* Connection #0 to host 192.168.57.101 left intact
if url params contain special signs like "+", use --data-urlencode for every param (containing special signs) of them:
curl -G -H "Accept:..." -H "..." --data-urlencode "beginTime=${time}+${zone}" --data-urlencode "endTime=${time}+${zone}" "${url}"
possible duplicate of What is the cURL command-line syntax to do a POST request?
– Michael Durrant – 2015-03-20T15:35:13.653Feels like a possible dupe of http://superuser.com/questions/149329/what-is-the-curl-command-line-syntax-to-do-a-post-request I know this one is specific about headers and the like but the answers to the other question also handle that. I don't usually mark such an old popular question as a dupe but this is an exception. Might need to move some stuff over for completeness.
– Michael Durrant – 2015-03-20T15:36:37.453In fact the other answer very specifically mentions
--header
and this one does not – Michael Durrant – 2015-03-20T15:38:22.353