嘿@mohsen 上面的 Post 请求中缺少正文,对于文本中的关键字,示例请求看起来像这样,还要在下面的 curl 请求中替换 API-KEY。在公共网站上发布 API 密钥并不理想
curl -X POST \
'https://gateway.watsonplatform.net/natural-language-understanding/api/v1/analyze?version=2017-01-11' \
-u "apikey:<API-KEY>"\
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"text":"Iran Warns Of Retaliation If U.S. Breaches Nuclear Deal. Iran Supreme Leader Ayatollah Khamenei is warning that Tehran will retaliate if the sanctions are approved.",
"features": {
"keywords":{
"sentiment":true
}
},
"language":"en"
}'