Context
I've written a JS function that sends a POST request to my API endpoint with the contents of an image file. Part of the requirement is to also send file-related information as part of the request. Encoding the request as multipart is not an option for me, so the solution I've written involves putting the information as part of the request headers.
Question
I noticed on a related question that this approach is not suggested as an option, so I'm wondering if my solution is not considered a good practice and if there's any potential downsides. So far the code I wrote works as expected, but I wanted to gut check here.