我试图创造一个环境,开始使用我的沃森发现服务在布卢米克斯创建。
在get开始文档之后,我输入了以下代码(在cmd中):
curl -X POST -u "{username}":"{password}" -H "Content-Type: application/json" -d '{ "name":"my-first-environment", "description":"exploring environments", "size":0}' "https://gateway.watsonplatform.net/discovery/api/v1/environments?version=2016-12-01"
我确保输入了正确的服务凭据,但我得到了一个我不明白的错误:
{ "code" : 401 , "error" : "Not Authorized" , "description" : "2017-05-23T08:53:35-04:00, Error ERCDPLTFRM-INVLDCHR occurred when accessing https://gateway.watsonplatform.net/discovery/api/v1/environments?version=2016-12-01, Tran-Id: gateway-dp02-1408488112 - " }
在浏览器中键入链接并手动输入凭据时,不会出现任何错误。
有人了解这个错误并能帮助我吗?
提前感谢并致以最良好的问候
埃米拉
发布于 2017-05-23 13:50:09
您确定您正在提供Discovery凭据吗?如果你检查你的用户名和密码是否正确的话。
当您访问Discovery时,有一些名称为:服务凭据的选项。
用以下值替换username和password。
请参见访问的一个示例:

curl -X POST -u "USERNAME":"PASSWORD" -H "Content-Type: application/json" -d '{ "name":"my-first-environment", "description":"exploring environments", "size":0}' "https://gateway.watsonplatform.net/discovery/api/v1/environments?version=2016-12-01"编辑:
curl -X POST -u "{username}":"{password}" -H "Content-Type: application/json" -d '{ "name": "test_collection", "description": "My test collection", "configuration_id": "{configuration_id}" }' "https://gateway.watsonplatform.net/discovery/api/v1/environments/{environment_id}/collections?version=2016-12-01"https://stackoverflow.com/questions/44136147
复制相似问题