0
votes

I'm trying to list the indexes, but the call fails with an exception.

db = cloudant.db.use(dbName);

db.index(function(er, result) {
  if (er) {
    throw er;
  }
// ...
}

Find call also fails with the same exception.

db.find(params, function(error, result) {
  if (error) {
    console.log('#### ' + error);
  }
//...
}
Error: **

Only DELETE,GET,HEAD,PUT allowed`

** at Request._callback (.../node_modules/cloudant/node_modules/nano/lib/nano.js:248:15) at Request.self.callback (.../node_modules/cloudant/node_modules/nano/node_modules/request/request.js:200:22) at emitTwo (events.js:87:13) at Request.emit (events.js:172:7) at Request. (.../node_modules/cloudant/node_modules/nano/node_modules/request/request.js:1046:10) at emitOne (events.js:82:20) at Request.emit (events.js:169:7) at IncomingMessage. (.../node_modules/cloudant/node_modules/nano/node_modules/request/request.js:973:12) at emitNone (events.js:72:20)

Appreciate your help getting through this, thank you very much.

1
My bad, there was a '/' at the end of the Cloudant URL which was causing the Cloudant special functions to fail.user6352602

1 Answers

0
votes

This error usually means either: - you are using a wrong/unexpected HTTP method (POST in this case?) - a wrong URL which is responding but obviously it is not expecting the request received