Base64Image in raw JSON

HI, im having an issue with your API using base64Image with JSON. My application requires JSON input. Im currently using Postman to
test, if i use one of test base64 strings from OCRSpace website and put in form-data or x-www-from-urlencoded in postman it works fine, but when i try to put it in raw in JSON, like:
{
“base64Image”: “base64string - too long to copy it here”
}
im getting: { "OCRExitCode": 99, "IsErroredOnProcessing": true, "ErrorMessage": [ "Unable to recognize the file type", "Unable to detect the file extension, or the file extension is incorrect, and no 'file type' provided in request. Please provide a file with a proper content type or extension, or provide a file type in the request to manually set the file extension." ], "ProcessingTimeInMilliseconds": "15" I tried to use filetype parameter with value of jpg, png, tiff depends on image but im still getting same error message. Anyone know the solution? Thanks in advance.

1 Like

Does it work with these base64 test strings (images)?

https://ocr.space/text/base64string1.txt

Yes, but only if you paste it in x-www-form-urlencoded or form-data in postman. When i try to use it as raw json like in the topic it gives the same error message about file type like in the topic.

Just started with OCR.space today and am looking for an answer to this same problem.
Using the helloworld example API in Postman, I get a successful response when sending an http Get request with the body as form-data, and a failed response when sending the body as raw JSON.

This is what the raw JSON body looks like:

{
    "language": "eng",
    "isOverlayRequired":false,
    "url":"http://dl.a9t9.com/ocrbenchmark/eng.png",
    "iscreatesearchablepdf":false,
    "issearchablepdfhidetextlayer":false,
    "filetype":"png"
}

Is it possible to use the API this way?