title: My POSTMAN requests works, but my seemingly identical IDE requests don't
body: <p>PARTIALLY SOLVED - I changed the request from</p>
  <pre><code>requests.post(url, headers = headers, data = data)
  </code></pre>
  <p>to:</p>
  <pre><code>requests.post(url, headers = headers, json = data)
  </code></pre>
  <p>and now it works. I am not sure why...</p>
  <p>Original Post:</p>
  <p>The code I am using below continues to provide a response:</p>
  <pre><code>{&quot;code&quot;:&quot;422&quot;,&quot;details&quot;:&quot;Unrecognized token 'adGroupId': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false'&quot;}
  </code></pre>
  <p>I am able to get a successful response with POSTMAN, and am failing to see the difference between this and my <code>requests</code> vscode attempts. FWIW, I simply copy the request body from the IDE and pasted it into POSTMAN as 'raw'.</p>
  <p>My 'request' library failing attempts in the IDE:</p>
  <pre><code>headers = {
    &quot;Amazon-Advertising-API-ClientId&quot;: clientid,
    &quot;Authorization&quot;: access,
    &quot;Amazon-Advertising-API-Scope&quot;:scope,
    &quot;Content-Type&quot;: &quot;application/json&quot;
  }
  
  data = {
    &quot;adGroupId&quot;:adgroupid,
    &quot;keywords&quot;: [
      {
        &quot;keyword&quot;: &quot;mini bricks&quot;,
        &quot;matchType&quot;: &quot;exact&quot;
      }
    ]
  }
  
  response = requests.post(
    'https://advertising-api.amazon.com/v2/sp/keywords/bidRecommendations',
    headers = headers,
    data = data
  )
  print(response.text)
  </code></pre>
  <p>My successful POSTMAN request headers and body:</p>
  <pre><code>Request Headers
  Amazon-Advertising-API-ClientId: ...
  Authorization: ...
  Amazon-Advertising-API-Scope: ...
  Content-Type: application/json
  Cache-Control: no-cache
  Postman-Token: ...
  Request Body
  {
    &quot;adGroupId&quot;:...,
    &quot;keywords&quot;: [
      {
        &quot;keyword&quot;: &quot;mini bricks&quot;,
        &quot;matchType&quot;: &quot;exact&quot;
      }
    ]
  }
  </code></pre>