flatiron / cradle

a high-level CouchDB client for Node.js
MIT License
1.38k stars 182 forks source link

adding additional HTTP request parameters in db.save causes Couchdb error #83

Open pigmej opened 13 years ago

pigmej commented 13 years ago

When executing that code

db.save('52af4cfb898a612ec1dbe5db970004e6?w=2', {a:3}, function(err, res) { console.dir({err:err, res:res})})

The request in couchdb logs is:

PUT /test/52af4cfb898a612ec1dbe5db970004e6?w=2?

(see the trailing'?')

indexzero commented 12 years ago

@pigmej Why would you want to add these additional HTTP request parameters?

pigmej commented 12 years ago

@indexzero for bigcouch for example where you can control r,w parametres for single request.

mikepb commented 12 years ago

@pigmej I wrote my own CouchDB library after rewriting big chunks of cradle to make it more to my liking. My library is very much in alpha stages of development, but supports extensive configuration options, at the client level and at individual API calls. Check it out: clerk, a CouchDB library for Node.js. I'll be improving the library over time as I use it in my projects. Contributions are welcome.

indexzero commented 12 years ago

This should be easy to fix now that cradle@0.6.0 has been refactored to use `request.

sreuter commented 9 years ago

@pigmej Wondering if that's still happening. Did you try this with a more recent version already?