我得到了
"参数名称'文件'是无效的。有效参数:apikey,url,language,isoverlayrequired,base64image"
来自ocr.space API的,尽管他们的api要求"文件"参数和该参数在Postman和计算机浏览器中工作。但是当我把它放在phonegap应用程序上时,我收到错误。我不知所措。任何帮助,将不胜感激。这是我的ajax帖子。
function pickPhoto() {
navigator.camera.getPicture(send, onFail, { quality: 50,
destinationType: Camera.DestinationType.FILE_URL,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY });
}
function send(nativeURI) {
jQuery.ajax({type:"POST",
url:"https://api.ocr.space/parse/image",
data: {file:nativeURI},
headers:{apikey:"none of your business", language: "eng"},
success: function (ocrParsedResult) {
console.log(ocrParsedResult);