how to call IBM Watson services from javascript

后端 未结 4 1807
独厮守ぢ
独厮守ぢ 2021-01-14 11:31

I am implementing a virtual agent using IBM Watson services. My application is developed using Jquery, Angular JS & Java.Currently i am calling the watson services from

4条回答
  •  醉酒成梦
    2021-01-14 12:22

    Some Watson services support CORS, others do not. However, when accessing over CORS, you must use an Auth Token rather than a username/password combination*.

    This is a partial list of which services support CORS: https://github.com/watson-developer-cloud/node-sdk/tree/master/examples/webpack#important-notes

    Here are a couple of examples using the Node.js SDK:

    • Webpack: https://github.com/watson-developer-cloud/node-sdk/tree/master/examples/webpack
    • Browserify: https://github.com/watson-developer-cloud/node-sdk/tree/master/examples/browserify

    And, a whole host of examples with the Speech JavaScript SDK:

    • https://watson-speech.mybluemix.net/

    * There are a couple of services that use API keys rather than username/password combinations. In that case, you can use the API key directly from client-side code if the service supports CORS.

提交回复
热议问题