cURL POST请求问题
问题描述:
我试图使用google safe browsing API
来检查任何给定URL的分类。cURL POST请求问题
根据谷歌安全浏览API页面(https://developers.google.com/safe-browsing/v4/lookup-api),我发布cURL
到POST
a HTTP
请求并检查网站分类。
作为回报,我没有看到对POST'ed的回应。收到
响应:
#{}
所用命令:
#curl -H "Content-Type: application/json" -X POST -d ' { "client": { "clientId": "Test", "clientVersion": "1.0.0" }, "threatInfo": { "threatTypes": ["MALWARE", "SOCIAL_ENGINEERING"], "platformTypes": ["WINDOWS"], "threatEntryTypes": ["URL"], "threatEntries": [ {"url": "http://www.facebook.com"} ] } }' https://safebrowsing.googleapis.com/v4/threatMatches:find?key=AIzaSyD1IMgjaHEza6e9m_jwtjBgPmJX0IMKKIs HTTP/1.1
我已经检查了命令,但不知道在那里我犯错误。任何想法的人?
答
好了,可能是你的网址测试(www.facebook.com)根据谷歌是安全的 - 因为如果我发出你的命令,但对于ianfette.org,我得到这样的回应:
{
"matches": [
{
"threatType": "MALWARE",
"platformType": "WINDOWS",
"threat": {
"url": "http://ianfette.org"
},
"cacheDuration": "300s",
"threatEntryType": "URL"
}
]
}
我们需要在有X'ed的位置放置有效的API密钥。反正用API密钥更新。 – Arun