incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vlad GURDIGA <gurd...@gmail.com>
Subject Re: JSONView to the rescue
Date Fri, 30 Oct 2009 13:53:37 GMT
On Fri, Oct 30, 2009 at 2:53 PM, Nils Breunese <n.breunese@vpro.nl> 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.
>

Mime
View raw message