How can I use chunked transfer encoding in Laravel?

Good day. I am wondering if I can use chunked transfer encoding(further CTE) in API response? I have large data in the database and I need to transfer it to the client in one request. I've read a lot about the CTE mechanism, but I could not find how to implement this, unfortunately.

One important thing to mention: no pagination. It is supposed to be an autonomous system which returns data back to the client's endpoint, not to the web page.

As I mentioned, the data is stored in the database. The only problem is how to split the data into segments(chunks) and send them in one API response (one-by-one).

Thanks.

#php #laravel #rest

3 Likes15.00 GEEK