I have the following curl command which runs fine from bash shell
$ curl -d '{"img_url":"http://ec2-54-167-249-150.compute-1.amazonaws.com/IMG_86478_mono.bmp","engine":"tesseract"}' http://ec2-54-226-250-92.compute-1.amazonaws.com:8080/ocr
I now want to run this via a simple webpage with a button click. Here is my Javascript
function processImage()
{
$.ajax({
url: 'http://ec2-54-226-250-92.compute-1.amazonaws.com:8080/ocr',
cache: false,
type : "POST",
data: { img_url : 'http://ec2-54-167-249-150.compute-1.amazonaws.com/IMG_86478_mono.bmp',
engine : 'tesseract' },
dataType: 'json',
success: function(response)
{
alert("success");
}
});
}
but when I run this javascript via a webpage button click it gives me following error "NetworkError: 500 Internal Server Error - http://ec2-54-226-250-92.compute-1.amazonaws.com:8080/ocr" and my success() method is never called.
As I was saying I know there is nothing wrong with the server as it works fine when called from linux cmd prompt. Question is What is wrong with my javascript?