【发布时间】:2017-04-10 01:12:59
【问题描述】:
我正在尝试使用 Watson api 进行情绪分析。 代码非常简单。 但是为什么我总是收到这个错误??????
WatsonException: Error: unsupported media type, Code: 415
API 文档中没有关于此错误的信息。
from watson_developer_cloud import AlchemyLanguageV1
alchemy_language = AlchemyLanguageV1(url="https://gateway.watsonplatform.net/natural-language-understanding/api",
username="xxx",
password="xxx")
print(json.dumps(alchemy_language.sentiment(text="hehe")))
【问题讨论】:
-
在构造 AlchemyLanguageV1 对象或调用sentiment() 方法时是否会出错?
标签: python json get httprequest ibm-watson