title: How to parse binary string to dict ?
body: <p>I have <code>flask</code>-service. Sometimes I can get <code>json</code> message without a point at <code>http</code> header. In this case I'm trying to parse message from <code>request.data</code>. But the string from <code>request.data</code> is really hard thing to parse. It's a binary string like this:</p>
  
  <pre><code>b'{\n    "begindate": "2016-11-22", \n    "enddate": "2016-11-22", \n    "guids": ["6593062E-9030-B2BC-E63A-25FBB4723ECC", \n              "5A9F8478-6673-428A-8E90-3AC4CD764543", \n              "D8243BA1-0847-48BE-9619-336CB3B3C70C"]\n}'
  </code></pre>
  
  <p>When I'm trying to use <code>json.loads()</code>, I'm getting this error:</p>
  
  <pre><code>TypeError: the JSON object must be str, not 'bytes'
  </code></pre>
  
  <p>Function of converting to string (<code>str()</code>) doesn't work good too:</p>
  
  <pre><code>'b\'{\\n    "begindate": "2016-11-22", \\n    "enddate": "2016-11-22", \\n    "guids": ["6593062E-9030-B2BC-E63A-25FBB4723ECC", \\n              "5A9F8478-6673-428A-8E90-3AC4CD764543", \\n              "D8243BA1-0847-48BE-9619-336CB3B3C70C"]\\n}\''
  </code></pre>
  
  <p>I use <code>Python 3</code>. What can I do to parse <code>request.data</code> ?</p>