Problem
writeHttpDetails calls req.Write(w) after the transport has already drained the request body reader, so the dump shows headers with a non-zero Content-Length and no body.
Reproduction
$ http-assert -X POST -d 'THIS-IS-THE-REQUEST-BODY' --assert-status 999 http://127.0.0.1:8791/echo
…
FAILED: POST http://127.0.0.1:8791/echo (HTTP/1.1)
POST /echo HTTP/1.1
Host: 127.0.0.1:8791
User-Agent: Go-http-client/1.1
Content-Length: 24 ← claims 24 bytes
← ships zero
Why it matters
When a POST assertion fails, the first question is "what did I actually send?" — and that is exactly what the dump omits. The output is also self-contradictory as an HTTP message.
Affected code
main.go — Client.writeHttpDetails, called from Client.Do
Suggested fix
Buffer the -d payload and set req.GetBody, then re-attach a fresh reader before dumping (or keep the raw string alongside the request and print it explicitly).
Problem
writeHttpDetailscallsreq.Write(w)after the transport has already drained the request body reader, so the dump shows headers with a non-zeroContent-Lengthand no body.Reproduction
Why it matters
When a POST assertion fails, the first question is "what did I actually send?" — and that is exactly what the dump omits. The output is also self-contradictory as an HTTP message.
Affected code
main.go—Client.writeHttpDetails, called fromClient.DoSuggested fix
Buffer the
-dpayload and setreq.GetBody, then re-attach a fresh reader before dumping (or keep the raw string alongside the request and print it explicitly).