is it a good practice in general to return a formdata object back to the client in a rest api?
I'm trying to let users download files for github like pet project i'm trying to build but i want to add some other key-value data with those files just like how clients send formdata to the servers but i don't know if thats a good idea to begin with.
What other alternatives can i consider?
@vincent15000 well, i have seen some implementaitons of formdata objects in other langauges like dart where clients sends formdata/multipart to server so i assumed that would be applicable in php as well.
What to the right way to do the thing that I'm trying to do in your opinion?
@amro-baira23 I don't know dart, but it seems to be a frontend languague and as you say, dart can send formdata from clients to server and not from server to clients.
If you need to pass data from the server to the client, just send JSON datas.