title: Azure TimeSeries API call issue python requests
body: <p>I need help making a time series api call using python requests.</p>
  
  <p>My header and body look like the following :</p>
  
  <pre><code>header = {
              "Authorization": f"Bearer {token}",
              "Content-Type": "application/json"
          }
  body = {
              "getSeries": {
                  "timeSeriesId": idstring.split(','),
                  "searchSpan": {
                      "from": timefrom,
                      "to": timeto,
                  }
              }
          }
  </code></pre>
  
  <p>My request command is : </p>
  
  <pre><code>data = requests.post(f"https://{fqdn}/timeseries/query?api-version=2018-11-01-preview&amp;storeType=warmstore",
                               headers=header,
                               data=body)
  </code></pre>
  
  <p>If i send the header and body as are, I get "Unexpected character encountered while parsing value: g. Path '', line 0, position 0.\r\n"</p>
  
  <p>If i send them as body = json.dumps(json), there is no unexpected character problem, but I get the error message "'str' object has no attribute 'items'".</p>
  
  <p>I have also tried a solution i found with a custom dictionary that has double quotes instead of the standard single but that didn't work either. Bit stumped as to what to do.</p>
  
  <p>Can anyone help?</p>
  
  <p>Thanks</p>