I want to know what Content-Type to set for JSON lines (http://jsonlines.org/)?
I tried searching. Its not really application/json as the entire content is not JSON (each line is).
Thanks
I want to know what Content-Type to set for JSON lines (http://jsonlines.org/)?
I tried searching. Its not really application/json as the entire content is not JSON (each line is).
Thanks
JSON lines is supported by some AWS services and they use application/jsonlines
content type.
As per https://github.com/wardi/jsonlines/issues/9, there is no official mime type, but a convention of application/x-ndjson. Or application/x-jsonlines. Note that this issue has been sitting there since 2015, which might suggest that jsonlines is not exactly catching fire.
I have the server return text/plain; charset=utf8
for JSON Lines files. As @bmargulies says, application/x-ndjson
has limited support. At least with text/plain
users can see the data in their browser (rather than being shown a download/save as dialog). Setting the charset explicitly prevents random "corruption" by (un)helpful user agents.