I need to submit an image via jquery or javascript to an Amazon hosted API. I can send it by Postman, it shows me this code for sending:
var form = new FormData();
form.append("file", "http://www.site.com.br/2017-09-06-11-40-43.jpg");
var settings = {
"async": true,
"crossDomain": true,
"url": "url API",
"method": "POST",
"headers": {
"authorization": "Basic==",
"cache-control": "no-cache"
},
"processData": false,
"contentType": false,
"mimeType": "multipart/form-data",
"data": form
}
$.ajax(settings).done(function (response) {
console.log(response);
});
</script>
It returns me error 400. I tried via PHP curl and it will not too.