Closed gaaf closed 4 years ago
Hi! The problem is you are using the $this->reply()
helper to return non-JSON API content. The reply()
helper only returns JSON API responses, which is why you're getting the error.
You should probably use Laravel's response()
helper instead.
Thanks a lot, this works. Been staring blindly at this for some time.
Hi,
I'm trying to optionally send a
text/csv
response instead ofapplication/vnd.api+json
for some endpoint, but it always fails with the message:Codec does not support encoding JSON API content
.I added
text/csv
to the config:Implemented the
reading
hook in the controller, similar to the test/dummy app's avatar endpoint:When trying to get a CSV response with:
The controller hook is called and returns a HTTP response, but then the stack fails:
Package versions:
cloudcreativity/laravel-json-api: v1.7.0 neomerx/json-api: v1.09
What am I missing here?