0

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. Commented May 18, 2016 at 20:55

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for your response. I turned on detailed logging for Cloudant and Nano modules, and figured out that the extra '/' at the end of the URL was causing the issue. I could verify this by trying it directly on the browser.
Thank you. If you found it useful, please accept the answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.