IBM Watson Assistant: How to solve web_action error “Internal error: Content-type can not be retrieved.”

99封情书 提交于 2021-02-10 14:26:48

问题


I'm trying to connect IBM Cloud Functions with a Watson Assistant dialog as web_action. So I have specified web_action as following in watson dialog json editor.

"actions": [
    {
      "name": "rajesh@heltha.co_dev/default/callKinvey",
      "type": "web_action",
      "parameters": {
      },
      "credentials": "$private.mycredential",
      "result_variable": "context.my_input_returned"
    }
  ]

Now, the issue is while testing assistant I'm getting following error

Internal error: Content-type can not be retrieved. (and there is 1 more error in the log)

Following is my function that is created on IBM-cloud and enabled for Web Action:

/**
  *
  * main() will be run when you invoke this action
  *
  * @param Cloud Functions actions accept a single parameter, which must be a JSON object.
  *
  * @return The output of this action, which must be a JSON object.
  *
  */
function main(params) {
    return { message: 'Hello World' };
}

CURL of my function is:

curl -u API-KEY -X POST https://us-south.functions.cloud.ibm.com/api/v1/namespaces/rajesh@heltha.co_dev/actions/callKinvey?blocking=true

回答1:


The easiest way to solve this type of error is to append .json to your endpoint.



来源:https://stackoverflow.com/questions/55571788/ibm-watson-assistant-how-to-solve-web-action-error-internal-error-content-typ

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!