REST/JSON: Should I include a newline after the JSON string?

Posted by Mark Harrison on Stack Overflow See other posts from Stack Overflow or by Mark Harrison
Published on 2010-04-20T00:24:52Z Indexed on 2010/04/20 0:33 UTC
Read the original article Hit count: 304

Filed under:
|
|

If I'm returning ["foo"] from a RESTful web query, Which of these is more proper? Will pedantic REST parsing die on the newline?

["foo"]\n     (with newline, Content-Length=8)
["foo"]       (no newline, Content-Length=7)

For easy regression testing I like the form with the newline, but I want to make sure I won't be breaking any application frameworks that might have a more strict view of the REST format.

© Stack Overflow or respective owner

Related posts about web-services

Related posts about rest