title: Python - Attempt to decode JSON with unexpected mimetype:
body: <p>I recently swapped over from requests to aiohttp because I couldn't use it in asyncio loops.</p>
  
  <p>The swap went perfectly and everything goes well except for one thing. My console is full of </p>
  
  <pre><code>Attempt to decode JSON with unexpected mimetype:
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Attempt to decode JSON with unexpected mimetype: txt/html; charset=utf-8
  </code></pre>
  
  <p>My code has a list of sites it goes too and grabs JSON from, Each site is different but my loop is basically the same for each of them, Ive simplified it here:</p>
  
  <pre><code>PoolName = "http://website.com"
  endpoint = "/api/stats"
  headers = "headers = {'content-type': 'text/html'}" #Ive tried "application/json" and no headers
  async with aiohttp.get(url=PoolName+endpoint, headers=headers) as hashrate:
                  hashrate = await hashrate.json()
  endVariable = hashrate['GLRC']['HASH']
  </code></pre>
  
  <p>It works perfectly, connects to the site grabs the json and sets endVariable correctly. but for some reason </p>
  
  <pre><code>Attempt to decode JSON with unexpected mimetype:
  </code></pre>
  
  <p>prints every time it goes through the loop. Which is annoying because it prints stats to the console and they get lost in the the errors each time it grabs a sites json</p>
  
  <p>Is there a way to fix this error or to hide it?</p>