Post method return "Unable to recognize the file type"

Hi all. i’m trying to work with the OCR API(free) but i get the same error for each POST call i make. i’m writing in JavaScript using node-fetch for the api calls and Jest.
here is an example :
const pdfURL = ‘’;
var myHeaders = new Headers();
myHeaders.append(“apikey”, “xxxxxxxxxxxx”);
var formdata = new FormData();
formdata.append(“url”, pdfURL);
formdata.append(“language”, “eng”);
formdata.append(“scale”, “true”);
formdata.append(“content-type”, “application/pdf”);
formdata.append(“filetype” , “PDF”);
formdata.append(“isOverlayRequired”, “false”);
formdata.append(“iscreatesearchablepdf”, “false”);
formdata.append(“IsErroredOnProcessing” , “false”);
formdata.append(“issearchablepdfhidetextlayer”, “false”);
formdata.append(“detectOrientation”, “false”);
formdata.append(“isTable”, “true”);
var requestOptions = {
method: ‘POST’,
headers: myHeaders,
body: formdata,
redirect: ‘follow’
await fetch(, requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log(‘error’, error));
in Postman everything works with no errors. this is the same code that come from Postman. and still i always get : " {“OCRExitCode”:99,“IsErroredOnProcessing”:true,“ErrorMessage”:[“Unable to recognize the file type”],“ProcessingTimeInMilliseconds”:“11”}"
anyone can tell what am i missing? what i’m doing wrong ?

thanks in advance for any help

You can use the Postman code export to generate working code:

This is an example for PHP, but it works the same for Javascript.