|
本帖最后由 高飞 于 2017-1-22 11:37 编辑
现在测试在苹果5S及电脑端没有问题,苹果6及meizu mx4下都有问题,错误信息:networkerror:failed to execute 'send' on 'xmlhttprequest':failed to load ''
代码如下:
var url = "http://api.hanvon.com/rt/ws/v1/ocr/bcard/recg?key="+key+"&code=cf22e3bb-d41c-47e0-aa44-a92984f5829d";
$.support.cors = true;
$.ajax({
type : "POST",
contentType : "application/octet-stream",
datatype : "json",
crossDomain: false,
jsonp:'callback',
url : url,
timeout:180000,
data : "{\"uid\":\"junit-test\",\"lang\":\"auto\",\"color\":\"original\",\"image\":\""+imageStr+"\"}",
async : false,
cache : false,
error:function(xhr, ajaxOptions, thrownError)
{
alert("There was an error in the ajax call: ["+xhr.status+"] ["+thrownError+"]");
seft.comp("WaitPopOver").hide();
},
success : function(data){
seft.comp('windowDialog3').open({
data : {
"IsNew" : false,
"IsCard":true,
"ClientObj" :data
}
});
seft.comp("WaitPopOver").hide();
}
});
问题找到,下面是抓取包数据的结果:
POST http://api.hanvon.com/rt/ws/v1/o ... 0-aa44-a92984f5829d HTTP/1.1Host: api.hanvon.com
Connection: keep-alive
Content-Length: 161
Accept: */*
Origin: http://api.hanvon.com
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Linux; Android 5.1; MX4 Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/40.0.2214.124 Mobile Safari/537.36 x5app/1.1.38
Content-Type: application/octet-stream
Referer: http://api.hanvon.com/v-MzYr2m-zh_CN-/OA/main/index.w
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,en-US;q=0.8
{"uid":"qeebaneAPP","lang":"auto","color":"original","image":"/9j/4RpvRXhpZgAATU0AKgAAAAgAEAEAAAMAAAABDMAAAAEBAAMAAAABBzAAAAECAA(这里参数给载取了)
*** FIDDLER: RawDisplay truncated at 128 characters. Right-click to disable truncation. ***
post是不限制传的参数的长度,但为什么这里会截取我的传的参数,搞不明白,有人碰到的吗?如何处理指教下。
|
|