Re: [go-nuts] Request Content Length zero when copy from another Request

2019-02-06 Thread Matteo Biagetti
Make sense, thanks for explanation Il giorno mercoledì 6 febbraio 2019 07:28:54 UTC+1, Burak Serdar ha scritto: > > On Tue, Feb 5, 2019 at 8:13 PM robert engels > wrote: > > > > That’s what I was trying to point out. Your design is not correct. The > Body is a Reader, not a Buffer - the

[go-nuts] Request Content Length zero when copy from another Request

2019-02-05 Thread matteo . biagetti
I've the following situation: I proxy a request to another server and when I made a POST and create a new request, the contentLength is zero: req2, _ := http.NewRequest(req.Method, newApiUrl , req.Body) fmt.Println("New request from body:", req2.ContentLength) // print 0