Re: [go-nuts] http resp.Write & httputil.DumpResponse include extra text with body

2024-09-13 Thread Eli Lindsey
DumpResponse is intended for debugging output, so it’s important for it to surface the chunked encoding. If you want to automatically dechunk, you can use higher level APIs - NewChunkedReader() handles dechunking, and is used internally by transport. -eli > On Sep 13, 2024, at 9:37 AM, Peter G

Re: [go-nuts] http resp.Write & httputil.DumpResponse include extra text with body

2024-09-13 Thread Robert Engels
If you set the content length in the header it should turn off chunked encoding. On Sep 13, 2024, at 8:38 AM, Peter Galbavy wrote:Makes sense and good to know, but for diag output is there any way to turn it off?On Friday 13 September 2024 at 14:25:19 UTC+1 Eli Lindsey wrote:Those are sizes from

Re: [go-nuts] http resp.Write & httputil.DumpResponse include extra text with body

2024-09-13 Thread Peter Galbavy
Makes sense and good to know, but for diag output is there any way to turn it off? On Friday 13 September 2024 at 14:25:19 UTC+1 Eli Lindsey wrote: > Those are sizes from chunked encoding. > > -eli > > On Sep 13, 2024, at 9:10 AM, Peter Galbavy wrote: > > I am trying to add some low level tr

Re: [go-nuts] http resp.Write & httputil.DumpResponse include extra text with body

2024-09-13 Thread Eli Lindsey
Those are sizes from chunked encoding. -eli On Sep 13, 2024, at 9:10 AM, Peter Galbavy wrote:I am trying to add some low level tracing to a client app to validate the responses coming from a SaaS platform.When I use either http's resp.Write(os.Stderr) or httputil.DumpResponse(resp, true) I see a