From user-return-7224-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri Oct 30 13:54:22 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 68403 invoked from network); 30 Oct 2009 13:54:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Oct 2009 13:54:22 -0000 Received: (qmail 3721 invoked by uid 500); 30 Oct 2009 13:54:21 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 3645 invoked by uid 500); 30 Oct 2009 13:54:21 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 3635 invoked by uid 99); 30 Oct 2009 13:54:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Oct 2009 13:54:21 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gurdiga@gmail.com designates 209.85.221.181 as permitted sender) Received: from [209.85.221.181] (HELO mail-qy0-f181.google.com) (209.85.221.181) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Oct 2009 13:54:18 +0000 Received: by qyk11 with SMTP id 11so1648228qyk.13 for ; Fri, 30 Oct 2009 06:53:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=49qEbDOR65arViO8Fp4UMz5T0aQu4bM1002S89YfjxI=; b=j0O7WJKb4xpjNRBhOVpF7kkQ4/KSF1puJLF0uHHmW+cKZ5fZWzQsh+5DBnkuURXOP4 wjTOXDzc0I1CzkRDVuK8xWuBPoigNLVJuf/A8QpM3CgmC244ThlE/QzYRzwyY0EM6YuN 2koxggmp3J2NUS7nyJraNUYkEzoPYCw7ma9E0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=VKUMSHNZGm1+a9//EscBDv+M/DGKYJaJnggNyUJv7l01dMh28GP8FHJMXmFZbsJmqh DamNFXsEvlKGS+J+bHmmz1eZr1O0yZP2sUAxCH7Kyh0G6Wx6jsBaUNwB/VhAvr/0Y1pV ytOXo0AgwPMx74GLA7I6V1Qa7rGD00a5Xd1fw= MIME-Version: 1.0 Received: by 10.239.145.18 with SMTP id q18mr166755hba.120.1256910837122; Fri, 30 Oct 2009 06:53:57 -0700 (PDT) In-Reply-To: <4AEAE1D4.1090804@vpro.nl> References: <4AEAE1D4.1090804@vpro.nl> From: Vlad GURDIGA Date: Fri, 30 Oct 2009 15:53:37 +0200 Message-ID: Subject: Re: JSONView to the rescue To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 On Fri, Oct 30, 2009 at 2:53 PM, Nils Breunese wrote: > Vlad GURDIGA wrote: > >> I guess everyone starting with CouchDB would like to have a little >> nicer error messages. >> JSONView* Firefox add-on with a little patch can ease a this pain. >> >> By default it beautifies only responses with content-type >> application/json. But this is easy "fixable" if you register it for >> text/plain responses too. Yeah, I now it's not a nice and clean >> approach but it looks like working for now. :) >> >> Here is how: >> - find the jsonview.js in the add-on directory (if you are not able >> find it you probably don't want to mess with it, sorry); >> - adjust postRegister and preUnregister functions; >> - restart Firefox. > > You can also just go the add-on's preferences and enable adding > application/json to the accept header. :o) That did not work for me because CouchDB responds with Content-Type: text/plain;charset=utf-8, this is why I came up with the JSONView + patch... [vladd@kpax ~]$ curl -v http://localhost:5984/cozy * About to connect() to localhost port 5984 (#0) * Trying ::1... Connection refused * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 5984 (#0) > GET /cozy HTTP/1.1 > User-Agent: curl/7.19.6 (x86_64-redhat-linux-gnu) libcurl/7.19.6 NSS/3.12.4.1 Beta zlib/1.2.3 libidn/1.9 libssh2/1.0 > Host: localhost:5984 > Accept: */* > < HTTP/1.1 200 OK < Server: CouchDB/0.11.0b825472 (Erlang OTP/R12B) < Date: Fri, 30 Oct 2009 13:51:46 GMT < Content-Type: text/plain;charset=utf-8 < Content-Length: 191 < Cache-Control: must-revalidate < {"db_name":"cozy","doc_count":14,"doc_del_count":0,"update_seq":46,"purge_seq":0,"compact_running":false,"disk_size":5455961,"instance_start_time":"1256910656926977","disk_format_version":4} * Connection #0 to host localhost left intact * Closing connection #0 [vladd@kpax ~]$ > > Nils Breunese. >