incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From J Chris Anderson <jch...@gmail.com>
Subject Re: Customize 404 response?
Date Tue, 20 Apr 2010 15:58:31 GMT

On Apr 19, 2010, at 8:04 PM, 7zark7 wrote:

> Hi,
> 
> I was wondering if there is a way to return html content for 404 errors, instead of the
default json:
> 

This isn't possible in a general way. The CouchDB API is JSON based.

However, you can return custom 404s from a _show or _list function.

http://books.couchdb.org/relax/design-documents/shows

> HTTP/1.1 404 Object Not Found
> Server: CouchDB/0.11.0 (Erlang OTP/R13B)
> Date: Tue, 20 Apr 2010 02:58:22 GMT
> Content-Type: text/plain;charset=utf-8
> Content-Length: 41
> Cache-Control: must-revalidate
> 
> {"error":"not_found","reason":"missing"}
> 
> 
> Thanks


Mime
View raw message