mfinelli / cui

http request/response tui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add response size (bytes) to view

mfinelli opened this issue · comments

Best place is probably next to the "status" line e.g., "Status: 200, Response size: 400 bytes". It would be nice to make it human readable (with a toggle to raw bytes).

Hi, I have question about this issue . Is it right that response size in bytes is
body, err := ioutil.ReadAll(res.Body)
len(body) // <----

len(body) is probably good enough. In theory we could also read a Content-Length header if it exists, but not all webservers or response types will send that header so I think it's better to just read the actual size of the body once we have the whole thing.

Resolved in fd4d5e4