How to show timing details with HTTPie

2k Views Asked by At

This blog post shows that you can show timing details, e.g:

$ curl -w "@curl_format.txt" -o /dev/null -s https://jsonplaceholder.typicode.com/comments
     time_namelookup:  0.001478s
        time_connect:  0.010429s
     time_appconnect:  0.028095s
    time_pretransfer:  0.028209s
       time_redirect:  0.000000s
  time_starttransfer:  0.046213s
                     ----------
          time_total:  0.065945s

I think HTTPie is more user friendly, though. Is there a way to achieve similar thing on HTTPie?

2

There are 2 best solutions below

0
Tiger-222 On

Actually, that is the most awaited feature, see issue #243. It is not yet available as of HTTPie 2.6.0.

0
Martin Thoma On

HTTPie 3.0.0 has it: https://httpie.io/docs/cli/response-meta

$ http google.com --meta
Elapsed time: 0.080979083s

You can upgrade via:

pip install httpie --upgrade

(depending on your system, you might need sudo in front of the command ... and it might be pip3 on your system)