# `Req.NDJSON`
[🔗](https://github.com/wojtekmach/req/blob/v0.8.0-rc.0/lib/req/ndjson.ex#L1)

[NDJSON] decoding.

Each line is decoded as a separate JSON document. This module is used by `Req.Decode` on
`application/x-ndjson` and `application/ndjson`.

[NDJSON]: https://github.com/ndjson/ndjson-spec

## Examples

    iex> {:ok, resp, acc} =
    ...>   Req.stream(
    ...>     "http://httpbingo.org/stream/2",
    ...>     [],
    ...>     fn data, _resp, acc ->
    ...>       IO.inspect(data)
    ...>       {:cont, acc}
    ...>     end,
    ...>     decoders: [text: :ndjson] # endpoint sends content-type: text/plain
    ...>                               # so let's force ndjson.
    ...>   )
    # Output: %{"id" => 0, ...}
    # Output: %{"id" => 1, ...}
    iex> resp.status
    200
    iex> resp.body
    nil

---

*Consult [api-reference.md](api-reference.md) for complete listing*
