with correct applicationID and app_key (i tested the request with postman and it was successful).
The problem is when i use JS (Angular) - i get the below error:
(also in the title)
.
My question is what headers to use - in both Postman and Anguar I am using
Content-Type: multipart/form-data. There is no difference - or at least not something that is manually inserted.
And what shuld be the body of the request - there is no valid example in the dcumentation?
I assume the question is more related to how to send a file using Angular, isn’t it?
You should compose a Form (append a file) and send it to the server.
if it works with Postman you can generate code for various platforms/langs/env/libs etc.
Actually, I’m not aware of how this.http.post works, but I believe you need to create a FormData instance firstly and append a file to the form.
Have you asked how to upload file in the Angular community?
The question is why the header is not enough according to the error and the documentation?
I tried adding boundary to the headers but without success.
no, to upload a file to the server is not enough just add a header, check this post on how to send files from JS
I found the solution to the problem - the headers should NOT be set to Content-Type: multipart/form-data - the browser is doing it automatically, the file is uploading and the error is no longer present.