To create an outgoing POST request, func NewRequest() from net/http library is used. request body is parsed as a param. After request is created I set request headers using Set() func. After setting headers, request body is empty.
// create a new request
req, err = http.NewRequest(method, url string, body io.Reader) (*Request, error)
// set headers
// when I print req.Body at this stage, it's not empty
req.Header.set("foo", "bar")
// when I print req.Body at this stage, it's empty
Any of you have met this problem before? and any idea for this?