'Return many files with json from backend to client
I want to know may i respond to client from backend controller with many files (with application/octet-stream). It will be more better, if i respond array of files with json data (for example: user data (nickname, email) with his collection of images in the same response). So frontend can send json + several files to backend. Can i do the same thing back?
After research i found only information about opportunities to respond application\json and the only file separately (in different requests and responces).
I use nestjs. Nestjs wraps multer lib for handling multipart\form-data.
Of course, there is way to use base64 for files, but i found that better way for files is to use content-type.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|