Hi, I’m working on it for days and don’t know what to do anymore, so my problem:
const headers : HttpHeaders = new HttpHeaders()
.set('Authorization', `Basic ${btoa(this.PUBLISHABLE_KEY)}`)
.set('Content-Type', 'multipart/form-data;boundary=---011000010111000001101001');
//.set('Content-Type', '');
const fileBlob : any = new Blob([fileImage], { type: `image/${mimeType}` });
const fd : FormData = new FormData();
fd.append('file', fileBlob, fileName);
fd.append('category', category);
return this.http.post(url, fd, { headers });
//return this.http.post(url, fd);
I used postman and it worked ok, but in my code nothing done.
I saw answers to get rid of Content-Type, but even if I put this = ‘’ I got CORS errors from server.
I don’t have access to the api it’s from a credit card.
I saw answers to get rid of headers, but I need to pass the authorization.
{“error”:{“status”:“API Configuration Error”,“status_code”:510,“type”:“processing_error”,“category”:“gateway_error”,“message”:“Internal server error”}}
Thanks in advanced.