OCR APi on SoapUI


#1

HI All,
I’m trying to use the API Post https://api.ocr.space//parse/image (with base64) on Soapui and not able to.
This is the structure that I’m using:
header:
apikey: xxxxxxxxxx
language: english
Body:
{
“base64Image”:“iVBORw…”
}
i’m getting "No file uploaded or URL or base64 provided"
Where do I do it wrong?
Please advice.
Thanks,
Lior grinberg


#2

Personally I have no experience with SoupUI for api testing, as we use Postman for our internal QA.

So as a first test, if you test the base64 sending with Postman, do you get the same result?

You probably know it, but just in case: Postman is a free Chrome/Win/Mac app, see https://ocr.space/ocrapi#postman

If you see the problem even with Postman, a screenshot of the result could be helpful.


#3

Thanks for the answer.
In postman it does work but my problem is that I need the request structure.
I’m working on service now application and in there I need to give it the body structure. The header I know.
And in soapui I can see the structure.
So can anyone provide to me the correct structure?
Thanks,
Lior grinberg


#4

I guess I don’t understand what you mean by “request structure”.

That said, we can of course create a sample for SoapUI, but it will take a few days (we are quite busy right now).


#5

I will really appreciate if you build an example in Soapui.
Thank you very much.
Lior grinberg


#6

Hi liorg,

here is a sample I extracted from a successfull Postman call.
I changed the end of the apikey and shorten the file content in code bellow.

I hope this can help you !

POST /parse/image HTTP/1.1
Host: api.ocr.space
Cache-Control: no-cache
Postman-Token: 9ab96540-2a23-9ae0-af00-9a56d1828e9f
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name=“apikey”

987479216988[XYZ]
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name=“language”

fre
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name=“isCreateSearchablePdf”

True
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name=“isOverlayRequired”

False
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name=“base64image”

data:image/jpeg;base64,/9j/4AAQSkZJRgABAAEAY[…]

------WebKitFormBoundary7MA4YWxkTrZu0gW–