Closed cdent closed 3 years ago
If a jsonlines response handler is created, it should be a separate package.
To complicate matters, it turns out there is an emerging way to present streaming json objects, popularized (by not pioneered) by kubernetes "watch" style requests:
Transfer-Encoding: chunked
Content-Type: application/json;stream=watch
[one object per chunk]
This is super easy to parse with python requests, lots of the various stream json processors, etc, so it's not going to go away.
But there are some issues with it:
stream=
but it's not clear if this is normativeI'm trying the second option, just to see...
I'm trying the second option, just to see...
works but seems a weak solution
If the response is
application/jsonlines
the JSON content handler kicks in and attempts to decode the response from json, which fails as it treats the whole doc as one single json object, not lines of json.This is because the accept method for the handler is checking for a content type that starts with 'application/json'
So the simple fix is straightforward, but it might make better sense to create a jsonlines response handler and see if we can make a way to jsonpath on those lines.