9 // NoBody is a http.NoBody reader instructing Go HTTP client to not include
10 // and body in the HTTP request.
11 var NoBody = http.NoBody
13 // ResetBody rewinds the request body back to its starting position, and
14 // set's the HTTP Request body reference. When the body is read prior
15 // to being sent in the HTTP request it will need to be rewound.
17 // ResetBody will automatically be called by the SDK's build handler, but if
18 // the request is being used directly ResetBody must be called before the request
19 // is Sent. SetStringBody, SetBufferBody, and SetReaderBody will automatically
22 // Will also set the Go 1.8's http.Request.GetBody member to allow retrying
23 // PUT/POST redirects.
24 func (r *Request) ResetBody() {
25 body, err := r.getNextRequestBody()
31 r.HTTPRequest.Body = body
32 r.HTTPRequest.GetBody = r.getNextRequestBody