从我的message
代码调用Watson Assistant NodeJS
方法时,出现以下错误,
{ Error: Response not received. Body of error is HTTP ClientRequest object
at RequestWrapper.formatError (D:\avamar\avamar\Official\IBM Watson\Code\Coversation Simple example\node_modules\ibm-watson\node_modules\ibm-cloud-sdk-core\lib\requestwrapper.js:219:21)
at D:\avamar\avamar\Official\IBM Watson\Code\Coversation Simple example\node_modules\ibm-watson\node_modules\ibm-cloud-sdk-core\lib\requestwrapper.js:207:29
at process._tickCallback (internal/process/next_tick.js:68:7) message: 'Response not received. Body of error is HTTP ClientRequest object', body: Writable {
_writableState:
WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: true,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: true,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: null,
writelen: 0,
bufferedRequest: null,
lastBufferedRequest: null,
pendingcb: 0,
prefinished: false,
errorEmitted: false,
emitClose: true,
bufferedRequestCount: 0,
corkedRequestsFree: [Object] },
writable: true,
_events:
[Object: null prototype] {
response: [Function: handleResponse],
error: [Function: handleRequestError] },
_eventsCount: 2,
_maxListeners: undefined,
_options:
{ protocol: 'https:',
maxRedirects: 21,
maxBodyLength: Infinity,
path: '/identity/token',
method: 'post',
headers: [Object],
agent: [Agent],
auth: undefined,
hostname: 'iam.cloud.ibm.com',
port: null,
nativeProtocols: [Object],
pathname: '/identity/token' },
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 135,
_requestBodyBuffers: [ [Object] ],
_onNativeResponse: [Function],
_currentRequest:
ClientRequest {
_events: [Object],
_eventsCount: 6,
_maxListeners: undefined,
output: [],
outputEncodings: [],
outputCallbacks: [],
outputSize: 0,
writable: true,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: false,
_headerSent: true,
socket: [TLSSocket],
connection: [TLSSocket],
_header:
'POST /identity/token HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nContent-Type: application/x-www-form-urlencoded\r\nAuthorization: Basic Yng6Yng=\r\nUser-Agent: axios/0.18.1\r\nContent-Length: 135\r\nHost: iam.cloud.ibm.com\r\nConnection: close\r\n\r\n',
_onPendingData: [Function: noopPendingOutput],
agent: [Agent],
socketPath: undefined,
timeout: undefined,
method: 'POST',
path: '/identity/token',
_ended: false,
res: null,
aborted: undefined,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
_redirectable: [Circular],
[Symbol(isCorked)]: false,
[Symbol(outHeadersKey)]: [Object] },
_currentUrl: 'https://iam.cloud.ibm.com/identity/token' } }