]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blob - vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go
Transfer of provider code
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / aws / aws-sdk-go / aws / request / request_1_8.go
1 // +build go1.8
2
3 package request
4
5 import (
6 "net/http"
7 )
8
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
12
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.
16 //
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
20 // call ResetBody.
21 //
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()
26 if err != nil {
27 r.Error = err
28 return
29 }
30
31 r.HTTPRequest.Body = body
32 r.HTTPRequest.GetBody = r.getNextRequestBody
33 }