title: Upload a file to Amazon S3 with presigned url + PUT request but get error "SignatureDoesNotMatch" for "GET" in "StringToSign"
body: <p>I am trying to upload files to Amazon S3 with a presigned url with javascript fetch() as following(copy past from the chrome Developer tool)</p>
  <pre><code>fetch(&quot;https://.....amazonaws.com/.../copy.mp3?AWSAccessKeyId=...&amp;Signature=...&amp;Expires=1631443785&quot;, {
    &quot;headers&quot;: {
      &quot;content-type&quot;: &quot;audio/mpeg&quot;,
      &quot;sec-ch-ua&quot;: &quot;\&quot;Google Chrome\&quot;;v=\&quot;93\&quot;, \&quot; Not;A Brand\&quot;;v=\&quot;99\&quot;, \&quot;Chromium\&quot;;v=\&quot;93\&quot;&quot;,
      &quot;sec-ch-ua-mobile&quot;: &quot;?0&quot;,
      &quot;sec-ch-ua-platform&quot;: &quot;\&quot;macOS\&quot;&quot;
    },
    &quot;referrer&quot;: &quot;http://localhost:3000/&quot;,
    &quot;referrerPolicy&quot;: &quot;strict-origin-when-cross-origin&quot;,
    &quot;method&quot;: &quot;PUT&quot;,
    &quot;mode&quot;: &quot;cors&quot;,
    &quot;credentials&quot;: &quot;omit&quot;
  });
  </code></pre>
  <p>and it returns the following error &quot;SignatureDoesNotMatch&quot;:</p>
  <pre><code>&lt;Error&gt;
   &lt;Code&gt;SignatureDoesNotMatch&lt;/Code&gt;
   &lt;Message&gt;The request signature we calculated does not match the signature you provided. 
   Check your key and signing method.&lt;/Message&gt;
   &lt;AWSAccessKeyId&gt;...&lt;/AWSAccessKeyId&gt;
   &lt;StringToSign&gt;GET 1631443785 ..../copy.mp3&lt;/StringToSign&gt;
  ...
  &lt;/Error&gt;
  </code></pre>
  <p><strong>The <code>StringToSign</code> in the error says it's a &quot;GET&quot; request while I think that I am sending a PUT with fetch()</strong>.</p>
  <p>Besides, I try to run <code>$curl</code> like:</p>
  <pre><code>$curl --request PUT --upload-file copy.mp3  https://....'
  </code></pre>
  <p>and it works.</p>
  <p>Anything I am doing wrong here?</p>
  <p>Thank you in advance.. I have been blocked here for 2 days :(</p>