dialogflow / dialogflow-nodejs-client

Node.js SDK for Dialogflow
Apache License 2.0
659 stars 287 forks source link

ECONNRESET #93

Open rajnish-kumar-76 opened 6 years ago

rajnish-kumar-76 commented 6 years ago

HI, I have tried same text request but I always got "ECONNRESET" response from apiai. sample nodejs code as below. In the code I have hashed client access token used retrieved from apiai console.

`'use strict'

const apiai = require('apiai'); const apiaiClient = apiai("08*628**781***6e");

var options = { sessionId: '879uy73883' };

console.log("options object being sent is: %s", JSON.stringify(options)); var apiaiRequest = apiaiClient.textRequest('Hello', options); apiaiRequest.on('response', function(response) { console.log("Response received from apiai: %s", JSON.stringify(response)); }); apiaiRequest.on('error', function(error) { console.log("Error received from apiai: %s", JSON.stringify(error)); });`

Regards, -Rajnish

NoobTW commented 6 years ago

How about add an apiaiRequest.end(); in the end of your code?

rajnish-kumar-76 commented 6 years ago

This doesn't help. Same response. Output from node is :- options object being sent is: {"sessionId":"879uy73883"} Error received from apiai: {"code":"ECONNRESET"}

gbahamondezc commented 6 years ago

Same error here.

EDIT: For me request.end() really work as well.