CouchDB and malformed URLs
CouchDB chokes on malformed URLs. This request works in Firefox but not curl or when called from a PHP script. The problem is that the space after the comma in the endkey is not properly encoded. The solution is to remove the space.
Luckily the CouchDB team know about this (Doesn't gracefully handle malformed URLs) and hopefully will be fixing it soon.