-
I'm trying to do a simple PUT object in the Go V1 SDK with additional HTTP headers. When I append them to the request directly, I get a signature doesn't match failure. Is there a recommendation for how to go about this?
Here is similar invocation I have with |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Based on the code sample I'm assuming you are trying to do this with You can set request options either on the uploader (which will apply to all requests) or for a specific request. Apply to all requests from uploader: uploader := s3manager.NewUploader(sess, func(u *s3manager.Uploader) {
u.RequestOptions = append(u.RequestOptions, func(request *request.Request) {
request.HTTPRequest.Header.Add("my-header", "value")
})
}) Apply to a specific request: uploader.Upload(input, func(u *s3manager.Uploader) {
u.RequestOptions = append(u.RequestOptions, func(request *request.Request) {
request.HTTPRequest.Header.Add("my-header", "value")
})
}) The same pattern is used with the underlying S3 client: sess := session.Must(session.NewSession())
s3client := s3.New(sess)
input := s3.PutObjectInput{ /*...*/ }
req, resp := s3client.PutObjectRequest(&input)
req.HTTPRequest.Header.Add("my-header", "value") |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Based on the code sample I'm assuming you are trying to do this with
s3manager.Uploader
?You can set request options either on the uploader (which will apply to all requests) or for a specific request.
Apply to all requests from uploader:
Apply to a specific request:
The same pattern is used …