Hi Guys,
I discovered Google Safe Browsing today and have read and re-read the
V2 documentation a few times over to try and fully understand it. I'm
trying to build up a PHP version and am trying to get some sort of
download going so I can see some data and work on matching/processing
it (I'll work fully on the ADD/SUB at a later date). I keep getting
400 errors but can't see where I'm going wrong, any ideas?
<?php
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "
http://safebrowsing.clients.google.com/
safebrowsing/downloads?
client=api&apikey=<my_api_key>&appver=1.5.2&pver=2.2");
//Comment the above and comment out the below to switch to debugger
(shows POST request body)
//curl_setopt($ch, CURLOPT_URL, "
http://beaver6813.com/dev/xvu/class/
debug.php");
//Don't return any header stuff (I can see the response is 400 anyways
at the moment!)
curl_setopt($ch, CURLOPT_HEADER, 0);
//Return what it downloads
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
//Use POST
curl_setopt($ch, CURLOPT_POST, true);
//Set POST data
curl_setopt($ch, CURLOPT_POSTFIELDS, 'googpub-phish-shavar;a:1-3,5,8:s:
4-5');
//Temporary for debugging
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
echo curl_exec($ch);
curl_close($ch);
?>
Any pointers would be greatly appreciated!!
Thanks!!
--
You received this message because you are subscribed to the Google Groups "Google Safe Browsing API" group.
To post to this group, send email to
google-safe-...@googlegroups.com.
To unsubscribe from this group, send email to
google-safe-browsi...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/google-safe-browsing-api?hl=en.