couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manolo Padron Martinez <>
Subject Problems with Ruby + Json + CouchDB
Date Thu, 23 Jul 2009 10:55:18 GMT

I'm trying to get some documents with the body from CouchDB, I've try
to do it JavaScript and no problem but when I try it in Ruby:

require 'rubygems'
require 'json'
require 'net/http'

 id = ["603be1d626a743345cf58a55c2f0d6ed"]

 req ='')
 req["content-type"] = "application/json"
 req.body = JSON.generate(id)

 res = Net::HTTP.start('', '5984'){|http|

I always get an 400 {"error":"bad_request","reason":"Request body must
be a JSON object"}

Any idea?

Regards from Canary Islands

Manuel Padrón Martínez

View raw message