davecheney / httpstat

It's like curl -v, with colours.
MIT License
6.96k stars 382 forks source link

spool response.Body to a temporary file #35

Closed gbbr closed 7 years ago

gbbr commented 7 years ago

I like this tool :-)

Is this anywhere near to what you were aiming for?

gbbr commented 7 years ago

Right, I've omitted the -I flag...

I've amended my commit with some changes to support that. Not sure if this is the optimal solution.

gbbr commented 7 years ago

It seems that the body is being read (and discarded) even with the -I flag. I'm not sure if that's intended and if I was supposed to change it. Either way, I'll be away from Github for a week, so if this becomes urgent and someone else wants to pick it up, feel free to close ;-)

davecheney commented 7 years ago

It's fine to always read from resp.Body because it's guarenteed to be an io.Reader, not sometimes nil. However we shouldn't create a file on disk to write 0 bytes in the case where there is no body, like a 30x response, or a HEAD request.

On Sun, Sep 25, 2016 at 4:28 PM, Gabriel Aszalos notifications@github.com wrote:

It seems that the body is being read (and discarded) even with the -I flag. I'm not sure if that's intended and if I was supposed to change it. Either way, I'll be away from Github for a week, so if this becomes urgent and someone else wants to pick it up, feel free to close ;-)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/davecheney/httpstat/pull/35#issuecomment-249405454, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAcA8hjadDTcTDTpbMbBZs55VtFPCE2ks5qthSQgaJpZM4KFt9P .

davecheney commented 7 years ago

Hopefully #50 will have made this PR easier to integrate.

amy commented 7 years ago

@gbbr Hello! Looks like this has been handled by #48. May want to close your PR.

gbbr commented 7 years ago

Great! Thanks!