小编use*_*292的帖子

卷曲请求等效于VB.NET

实际上,我正在尝试使用Watson服务,该服务向URL发出请求,并且cURL代码如下所示.如何在Visual Studio中使用Visual Basic语言执行此请求的等效操作?

curl -X POST -u "{username}":"{password}" —-header "Content-Type:application/json" --data "{\"input\": {\"text\": \"Turn on the lights\"}, \"context\": {\"conversation_id\": \"1b7b67c0-90ed-45dc-8508-9488bc483d5b\", \"system\": {\"dialog_stack\": [\"root\"], \"dialog_turn_counter\": 1, \"dialog_request_counter\": 1}}}" "https://gateway.watsonplatform.net/conversation/api/v1/workspaces/25dfa8a0-0263-471b-8980-317e68c30488/message?version=2016-09-20"
Run Code Online (Sandbox Code Playgroud)

有关更多信息,请参阅文档的URL以及解决方案cURL:

https://www.ibm.com/watson/developercloud/conversation/api/v1/

凭证和其他一切都很好.我把它从我的Node.js示例中删除了:

var watson = require('watson-developer-cloud');

var conversation = watson.conversation({
  username: '1793094a-e543-4e3a-891d-4b619f21271d',
  password: 'xjmacpjHceRj',
  version: 'v1',
  version_date: '2016-09-20'
});

// Replace with the context obtained from the initial request
var context = {};

conversation.message({
  workspace_id: '7c7b099b-aed4-4d27-a379-8b2f33644600',
  input: {'text': 'Turn on the lights'},
  context: context
},  function(err, response) {
  if (err)
    console.log('error:', …
Run Code Online (Sandbox Code Playgroud)

vb.net curl watson-conversation

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

curl ×1

vb.net ×1

watson-conversation ×1