I am trying to create a service where a user will be able to fill out a form(all string data) and upload a file with it. For the frontend we are using Angular 8 and for the backend we are using Java. We have it set up using JBOSS but I don't know if that makes a difference here. When trying to submit we are getting a few errors that we are unable to fix. After doing many trial and error tests we are unsure of what to do.
When we leave the content type as undefined(no options specified in post method) we get: "415 Unsupported media type content-type application/octet-stream not supported"
If we set the content type specifically to undefined via options, it says cannot read property "length" of undefined
When we set the content type to multipart/form-data we get: "Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadException: the request was rejected because no multipart boundary was found" We've tried to set a boundary with it as well but it doesn't seem to work.
The method being used
and the error
Any suggestions would be greatly appreciated. If you need any other info let me know and I'll provide it.
Thanks!