title: How to fix the "Invalid JSON payload received. Unknown name" error
body: <p>I try to get a proper response from the Google Safe Browsing API v4. Although I get the error "Invalid JSON payload received. Unknown name".</p>
  
  <p>I have used a payload based on the payload example mentioned at <a href="https://developers.google.com/safe-browsing/v4/lookup-api" rel="noreferrer">https://developers.google.com/safe-browsing/v4/lookup-api</a> </p>
  
  <p>I have problems with the payload. I think it should be a string, not a real dict. When I use a dict I get the error: TypeError:  has type , but expected one of: str, unicode</p>
  
  <p>The code I used is:</p>
  
  <pre><code>result = urlfetch.fetch(url, method=urlfetch.POST, payload=payload)
  </code></pre>
  
  <p>The url is (with [api-key] is of course my api-key):</p>
  
  <pre><code>https://safebrowsing.googleapis.com/v4/threatMatches:find?key=[api-key]
  </code></pre>
  
  <p>The payload is the following string (not a python dict):</p>
  
  <pre><code>{
    "client": { 
       "clientId": "myproject", 
       "clientVersion": "42" }, 
    "threatInfo": { 
       "threatTypes": ["MALWARE", "SOCIAL_ENGINEERING"], 
       "platformTypes": ["WINDOWS"], 
       "threatEntryTypes": ["URL"], 
       "threatEntries": [ {"url":"http://www.example.com/"} ] } 
  }
  </code></pre>
  
  <p>As output I expected some JSON which indicates that this url is safe. However I get the following result:</p>
  
  <pre><code>{ 
    "error": {
      "code": 400,
      "message": "Invalid JSON payload received. Unknown name \"{\n    \"client\": {\n      \"clientId\":      \"myproject\",\n      \"clientVersion\": \"42\"\n    },\n    \"threatInfo\": {\n      \"threatTypes\":      [\"MALWARE\", \"SOCIAL_ENGINEERING\"],\n      \"platformTypes\":    [\"WINDOWS\"],\n      \"threatEntryTypes\": [\"URL\"],\n      \"threatEntries\": [\n        {\"url\":\"http://www.example.com/\"}\n      ]\n    }\n  }\": Cannot bind query parameter. Field '{\n    \"client\": {\n      \"clientId\":      \"myproject\",\n      \"clientVersion\": \"42\"\n    },\n    \"threatInfo\": {\n      \"threatTypes\":      [\"MALWARE\", \"SOCIAL_ENGINEERING\"],\n      \"platformTypes\":    [\"WINDOWS\"],\n      \"threatEntryTypes\": [\"URL\"],\n      \"threatEntries\": [\n        {\"url\":\"http://www' could not be found in request message.",
      "status": "INVALID_ARGUMENT",
      "details": [
        {
          "@type": "type.googleapis.com/google.rpc.BadRequest",
          "fieldViolations": [
            {
              "description": [similar as the message above]
            }
          ]
        }
      ]
    }
  }
  </code></pre>
  
  <p>Any ideas, what is wrong?</p>
  
  <p>Thanks</p>