Inhaltsverzeichnis

curl

Beispiele

Ausgabe formatieren

curl-format.txt:

    time_namelookup:  %{time_namelookup}\n
       time_connect:  %{time_connect}\n
    time_appconnect:  %{time_appconnect}\n
   time_pretransfer:  %{time_pretransfer}\n
      time_redirect:  %{time_redirect}\n
 time_starttransfer:  %{time_starttransfer}\n
                    ----------\n
         time_total:  %{time_total}\n
me@Dlocalhost /home/me $ curl -w "@curl-format.txt" -o /dev/null -s "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/8405_asbolus.jpg/450px-8405_asbolus.jpg"
    time_namelookup:  0.004
       time_connect:  0.016
    time_appconnect:  0.041
   time_pretransfer:  0.041
      time_redirect:  0.000
 time_starttransfer:  0.052
                    ----------
         time_total:  0.064

Include the HTTP-header in the output

The HTTP-header includes things like server-name, date of the document,HTTP-version and more…

me@localhost:~/Downloads$ curl -I https://heraldik-wiki.de/index.php/Hauptseite
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Fri, 30 Dec 2016 11:22:24 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 0
Connection: keep-alive
X-Content-Type-Options: nosniff
Vary: Accept-Encoding, Cookie
Cache-Control: s-maxage=1200, must-revalidate, max-age=0
Last-Modified: Fri, 30 Dec 2016 11:18:56 GMT
Location: https://heraldik-wiki.de/wiki/Hauptseite
X-Varnish: 22009262 22523063
Age: 207
Via: 1.1 varnish-v4
Strict-Transport-Security: max-age=31536000

Verbose-Output

me@localhost:~/Downloads$ curl -v https://heraldik-wiki.de/index.php/Hauptseite
*   Trying 138.201.32.144...
* TCP_NODELAY set
* Connected to heraldik-wiki.de (138.201.32.144) port 443 (#0)
* found 173 certificates in /etc/ssl/certs/ca-certificates.crt
* found 696 certificates in /etc/ssl/certs
* ALPN, offering h2
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
* 	 server certificate verification OK
* 	 server certificate status verification SKIPPED
* 	 common name: heraldik-wiki.de (matched)
* 	 server certificate expiration date OK
* 	 server certificate activation date OK
* 	 certificate public key: RSA
* 	 certificate version: #3
* 	 subject: CN=heraldik-wiki.de
* 	 start date: Sat, 12 Nov 2016 20:31:00 GMT
* 	 expire date: Fri, 10 Feb 2017 20:31:00 GMT
* 	 issuer: C=US,O=Let's Encrypt,CN=Let's Encrypt Authority X3
* 	 compression: NULL
* ALPN, server did not agree to a protocol
> GET /index.php/Hauptseite HTTP/1.1
> Host: heraldik-wiki.de
> User-Agent: curl/7.51.0
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Server: nginx
< Date: Fri, 30 Dec 2016 11:20:53 GMT
< Content-Type: text/html; charset=utf-8
< Content-Length: 0
< Connection: keep-alive
< X-Content-Type-Options: nosniff
< Vary: Accept-Encoding, Cookie
< Cache-Control: s-maxage=1200, must-revalidate, max-age=0
< Last-Modified: Fri, 30 Dec 2016 11:18:56 GMT
< Location: https://heraldik-wiki.de/wiki/Hauptseite
< X-Varnish: 20674668 22523063
< Age: 117
< Via: 1.1 varnish-v4
< Strict-Transport-Security: max-age=31536000
< 
* Curl_http_done: called premature == 0
* Connection #0 to host heraldik-wiki.de left intact

Siehe auch