I am new to backendless, I want to upload an image with simple js code but it gives me this error
{“code”:8002,“message”:“Could not parse request with message: Missing boundary header, status code 400, headers POST /custom-domain-app-id-place/custom-domain-api-key-place/files/?path=web//this-is-my-app-key-here/here-is-my-api-key/files/Pictures/testing-1.jpeg&overwrite=true”,“errorData”:{}}
I have been spending a lot of time but I have not found any solution. Below is the code I am using
var myHeaders = new Headers();
myHeaders.append("Content-Type", "multipart/form-data");
myHeaders.append("application-id", "my-app-id-here");
myHeaders.append("secret-key", "my-api-key-here");
myHeaders.append("application-type", "REST");
var formdata = new FormData();
formdata.append("image", "testing-1.jpeg");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: formdata
};
fetch("https://classicscissors.backendless.app/my-app-id-here/my-api-key-here/files/Pictures/testing-1.jpeg?overwrite=true", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Please help me, I have wasted a lot of time on this. Any little help would be highly appriciated