couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zachary Zolton <zachary.zol...@gmail.com>
Subject Re: VOTE: accept newline patch into CouchDB for 0.9
Date Sat, 31 Jan 2009 22:07:16 GMT
For the visual annoyance when using CURL:
+1 on the newlines

On Sat, Jan 31, 2009 at 3:42 PM, Brian Candler <B.Candler@pobox.com> wrote:
> +1 for the patch, namely, adding a single newline at the end of all
> couchdb-generated JSON documents and responses.
>
> Pros:
> - more convenient for command-line HTTP client use
> - more convenient for saving and editing documents off-line
> - more convenient for concatenating multiple responses into a single file
>
> Cons:
> - miniscule bandwidth penalty
> - err, that's it
>
> Any conformant(*) JSON parser will accept the newline, and in any case we
> already insert some arbitary newlines within certain query responses, so we
> are relying on clients having this capability.
>
> I don't think HTTP specs are important here. This is application/json, not
> text/json. In any case we may return JSON with arbitrarily long line
> lengths.
>
> Having the newline is just a feature which (IMO) can make couchdb data a
> little friendlier for its consumers.
>
> One might argue whether it should be \n or \r\n though :-(
>
> Regards,
>
> Brian.
>
> (*) www.json.org says "Whitespace can be inserted between any pair of
> tokens", without making it clear if end-of-file is a token, but RFC 4627 is
> much clearer.
>

Mime
View raw message