anta40
anta40

Reputation: 6743

How to show timing details with HTTPie

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?

Upvotes: 5

Views: 2927

Answers (2)

Martin Thoma
Martin Thoma

Reputation: 136605

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)

Upvotes: 6

Tiger-222
Tiger-222

Reputation: 7150

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

Upvotes: 1

Related Questions