title: Safe Browsing Lookup API (v4) Invalid JSON payload received
body: <p>I have a php script which tries to use google Safe Browsing Lookup API (v4), but I'm getting error "Invalid JSON payload received. Unknown name \"\": Root element must be a message..."</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;?php
  
  $data = '{
    "client": {
      "clientId": "TestClient",
      "clientVersion": "1.0"
    },
    "threatInfo": {
      "threatTypes":      ["MALWARE", "SOCIAL_ENGINEERING"],
      "platformTypes":    ["LINUX"],
      "threatEntryTypes": ["URL"],
      "threatEntries": [
        {"url": "http://www.google.com"}
      ]
    }
  }';
  
  
  $apikey = "my_secret_api_key";
  $url_send ="https://safebrowsing.googleapis.com/v4/threatMatches:find?key=".$apikey."";
  
  $str_data = json_encode($data);
  
  function sendPostData($url, $post){
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", 'Content-Length: ' . strlen($post)));
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  $result = curl_exec($ch);
  return $result;
  }
  
  $jaahas = sendPostData($url_send, $str_data);
  
  echo "&lt;pre&gt;";
  var_dump($jaahas);
  
  ?&gt;
  </code></pre>
  
  <p>Is there something wrong with the json-data array formatting or what might be the problem?</p>