I'm returning an array from a controller method in Laravel. Laravel interprets this to mean I want to send JSON, which is great, but it doesn't set the Content-Length
and instead uses Transfer-Encoding: chunked
.
My responses are tiny, so I don't want to chunk them. How can I disable chunked encoding + enable Content-Length?
I'm using nginx for the server, if relevant.
My solution is adding
content-length
headers to the response, thenchunked-transfer
will be replacedyou can try it with postman
for JSON content, just add content type in headers