curl -X POST -u "{username}:{password}"--header "Content-Type: application/Json"--data-binary @profile"https://gateway.watsonplatform.net/personality-insights/API/v3/profile?version=2016-10-20&consumption_preferences=true&raw_scores=true"解决方法 您可以使用 Watson Developer Cloud .NET Standard SDK.使用NuGet安装Personality Insights服务
Install-Package IBM.WatsonDeveloperCloud.PersonalityInsights -Pre
实例化服务
// create a Personality Insights Service instancePersonalityInsightsService _personalityInsights = new PersonalityInsightsService();// set the credentials_personalityInsights.SetCredential("<username>","<password>");
致电该服务
var results = _personalityInsights.GetProfile(ProfileOptions.CreateOptions() .WithTextPlain() .AsEnglish() .AcceptJson() .AcceptEnglishLanguage() .WithBody("some text"));
在将来的版本中,您将能够使用命名参数而不是构建选项来调用服务.
var results = _personalityInsights.GetProfile( "<input>","<content-type>","<content-language>","<accept>","<accept-language>","<raw-scores>","<csv-headers>" "<consumption-preferences>","<version>" );总结
以上是内存溢出为你收集整理的如何从.net核心调用ibm watson api全部内容,希望文章能够帮你解决如何从.net核心调用ibm watson api所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)