Récupération du script :

Recupération du script

1 $ wget https://raw.githubusercontent.com/reorx/httpstat/master/httpstat.py

Utilisation :

La commande et ses options

 1 $ ./httpstat.py -h
 2 Usage: httpstat URL [CURL_OPTIONS]
 3        httpstat -h | --help
 4        httpstat --version
 5 
 6 Arguments:
 7   URL     url to request, could be with or without http(s):// prefix
 8 
 9 Options:
10   CURL_OPTIONS  any curl supported options, except for -w -D -o -S -s,
11                 which are already used internally.
12   -h --help     show this screen.
13   --version     show version.
14 
15 Environments:
16   HTTPSTAT_SHOW_BODY    Set to true to show resposne body in the output,
17                         note that body length is limited to 1023 bytes, will be
18                         truncated if exceeds. Default is false.
19   HTTPSTAT_SHOW_SPEED   Set to true to show download and upload speed.
20                         Default is false.
21   HTTPSTAT_SAVE_BODY    By default httpstat stores body in a tmp file,
22                         set to false to disable this feature. Default is true
23   HTTPSTAT_CURL_BIN     Indicate the curl bin path to use. Default is curl
24                         from current shell $PATH.
25   HTTPSTAT_DEBUG        Set to true to see debugging logs. Default is false

Utilisation avec affichage de la vitesse de téléchargement.

 1 $ export HTTPSTAT_SHOW_SPEED=true
 2 $ ./httpstat.py https://www.example.com
 3 
 4 HTTP/1.1 200 OK
 5 Cache-Control: max-age=604800
 6 Content-Type: text/html
 7 Date: Thu, 06 Oct 2016 19:09:28 GMT
 8 Etag: "359670651+gzip+ident"
 9 Expires: Thu, 13 Oct 2016 19:09:28 GMT
10 Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT
11 Server: ECS (iad/18CB)
12 Vary: Accept-Encoding
13 X-Cache: HIT
14 x-ec-custom-error: 1
15 Content-Length: 1270
16 
17 Body stored in: /var/folders/k3/1hynv9s11m97xn852sq79n_m0000gn/T/tmpw3Yvg6
18 
19   DNS Lookup   TCP Connection   TLS Handshake   Server Processing   Content Transfer
20 [    10ms    |       0ms      |     435ms     |       131ms       |        0ms       ]
21              |                |               |                   |                  |
22     namelookup:10ms           |               |                   |                  |
23                         connect:10ms          |                   |                  |
24                                     pretransfer:445ms             |                  |
25                                                       starttransfer:576ms            |
26                                                                                  total:576ms
27 28 speed_download: 2.2 KiB/s, speed_upload: 0.0 KiB/s