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}"
Curl has options to control the TLS version used. At the date of the last revision to this answer, if you want to specify that TLS 1.2 is used but not 1.1 or 1.3 etc, you need something like
curl --tlsv1.2 --tls-max 1.2 ...
There have been several relevant changes in Curl since the original question was asked.
Version 7.54.0
Since version 7.54.0 the behaviour has changed, see nelsonda's answer.
Options like --tlsv1.2
now specify a minimum version that is to be used, they no longer specify the exact version to be used.
To specify an exact version to be used you likely have to also specify a value for --tls-max
curl --tlsv1.2 --tls-max 1.2 ...
Version 7.52.0
Version 7.52.0 introduced --tlsv1.3
in addition to the other options listed below.
Version 7.34.0
Since version 7.34.0, Curl has options --tlsv1.0
, --tlsv1.1
and --tlsv1.2
for this purpose.
The manpage said
-1, --tlsv1
(SSL) Forces curl to use TLS version 1.x when negotiating with a remote TLS server. You can use options --tlsv1.0, --tlsv1.1, and --tlsv1.2 to control the TLS version more precisely (if the SSL backend in use supports such a level of control).
...
--tlsv1.2
(SSL) Forces curl to use TLS version 1.2 when negotiating with a remote TLS server. (Added in 7.34.0)
Best Answer
How to make
curl
disable html outputUse the
-s
flag (for silent operation) and redirect stout (>
) to (eg)/dev/null
(or, if you're on Windows, simplyNUL
)This, inc combination with
-D <file>
(aka--dump-header
) may give you the output you are looking for.The curl manpage has more information on the command-line options which may be helpful.
Example