10

I need to upload a file to S3 with postman for testing. I have a generated presigned URL from S3.

But I don't know how to configure postman correctly for doing this PUT request to my generated presigned URL.

The response on postman with malformed headers is:

<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>

the params for the presigned request:

const params = {
  Bucket: 'ss-files-dev',
  Key: 'dansero.jpg',
  ContentType: 'image/jpeg',
  Expires: 100
};

I get the URL, then enter it in postman, with PUT request, but the headers are not complete? 1. if I add content-type on header, there is no response from server 2. in body for the request Im attaching file as "binary"

postmanConfig

How to do my PUT request from postman?, thanks

3 Answers 3

10

For me, Postman added hidden headers. If I remove the Content-Type header, the Put worked as expected.

Sign up to request clarification or add additional context in comments.

Comments

5

Make sure about the following things:

1-The file name equal and same as the key when you get the signed URL.

2-Get the signed URL for putObject by passing the right parameter to getSignedUrl.

For put request not needs to set any additional headers.

2 Comments

hi @reza, I unticked all the headers values, and the name is equal in file and request for signed url, what else can it be? thanks!
Please check this question and answer; I have the same advice for both case stackoverflow.com/questions/51414212/…
2

I was able to get this working in Postman using a POST request with “form-data” input. I put all the details in this stack overflow post.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.