前端 是HTML,通过AJAX异步调用,
其中masterString是将JSON格式的数组转换成string,(使用json2.js与自己写的jsonToString)均有问题。
$.ajax({
url: "../Services/Service" + handletype + ".ashx",
type: "post",
dataType: "text",
data: "add=fl&result=" + masterString + "&encoded=" + encodeURIComponent(masterString),
async: true,
success: function (data) {}
});
后台是.NET写的ashx的generic handler,后台捕获数据时发现:
约5000次请求中会有1-2次数据异常,
key:add
value:fl
key:result
value:{"MasterID":"7","UserOpenID":"","QAList":[{"Q":"733","A":"2072"},{"Q":"734","A":"2076"},{"Q":"735","A":"2079"},{"Q":"736","A":"2082"},{"Q":"737","A":"2085"},{"Q":"738","A":"2088"},{"Q":"739","A":"2091"},{"Q":"740","A":"2094"},{"Q":"741","A":"2097"},{"Q":"742","A":"2099"},{"Q":"743","A":"2103"},{"Q":"744","{"Q":"747","A":"2114"},{"Q":"748","A":"2119"},{"Q":"749","A":"2122"},{"Q":"750","A":"2123"},{"Q":"751","A":"2128"},{"Q":"752","A":"2129"},{"Q":"753","A":"2134"},{"Q":"754","A":"2137"},{"Q":"755","A":"2138"},{"Q":"756","A":"2142"},{"Q":"757","A":"2144"},{"Q":"758","A":"2148"},{"Q":"759","A":"2150"},{"Q":"760","A":"2151"},{"Q":"761","A":"2154"},{"Q":"762","A":"2158"},{"Q":"763","A":"2163"},{"Q":"764","A":"2168"},{"Q":"765","A":"2173"}]}
key:encoded
value:{"MasterID":"7","UserOpenID":"","QAList":[{"Q":"733","A":"2072"},{"Q":"734","A":"2076"},{"Q":"735","A":"2079"},{"Q":"736","A":"2082"},{"Q":"737","A":"2085"},{"Q":"738","A":"2088"},{"Q":"739","A":"2091"},{"Q":"740","A":"2094"},{"Q":"741","A":"2097"},{"Q":"742","A":"2099"},{"Q":"743","A":"2103"},{"Q":"744","A":"2106"},{"Q":"745","A":"2109"},{"Q":"746","A":"2112"},{"Q":"747","A":"2114"},{"Q":"748","A":"2119"},{"Q":"749","A":"2122"},{"Q":"750","A":"2123"},{"Q":"751","A":"2128"},{"Q":"752","A":"2129"},{"Q":"753","A":"2134"},{"Q":"754","A":"2137"},{"Q":"755","A":"2138"},{"Q":"756","A":"2142"},{"Q":"757","A":"2144"},{"Q":"758","A":"2148"},{"Q":"759","A":"2150"},{"Q":"760","A":"2151"},{"Q":"761","A":"2154"},{"Q":"762","A":"2158"},{"Q":"763","A":"2163"},{"Q":"764","A":":"2163"},{"Q":"764","A":"2168"},{"Q":"765","A":"2173"}]}
发现:
不进行encode在Q744处出现异常(异常位置随机,每次都不一样。){"Q":"744","{"Q":"747","A":"2114"},encode部分在764处异常,"Q": "764","A": ":"2163"},
求各位大神帮忙支招。
有时候数据还是这样的
FORM DATA:
key:
value:FF�f�b'V7W�Gӷ"�7GV'�D"�"c"�"U7V'�V�D"�""�"Ė7G"���""�"cc�"�""�"�S#"�·""�"cs"�""�"�Sc"�·""�"cs"�""�"�c"�·""�"cs#"�""�"�c3"�·""�"cs3"�""�"�c�"�·""�"csC"�""�"�sC"�·""�"csS"�""�"�sS"�·""�"csc"�""�"�ss"�·""�"css"�""�"��"�·""�"cs�"�""�"��C"�·""�"cs�"�""�"���"�·""�"c�"�""�"��#"�·""�"c�"�""�"��s"�·""�"c�#"�""�"�"�·""�"c�3"�""�"�S"�·""�"c�C"�""�"��"�·""�"c�S"�""�"�#"�·""�"c�c"�""�"�S"�·""�"c�s"�""�"��"�·""�"c��"�""�"�#S"�·""�"c��"�""�"�#s"�·""�"c�"�""�"�3#"�·""�"c�"�""�"�3c"�·""�"c�#"�""�"�3�"�·""�"c�3"�""�"�Cc"�·""�"c�C"�""�"�Cs"�·""�"c�S"�""�"�S"�·""�"c�c"�""�"�SS"�·""�"c�s"�""�"�S�"�·""�"c��"�""�"�cS"���bV�6�FVF�Rs$R##�7GV'�DR##R3R##cR##R#4R##U7V'�V�DR##R3R##R##R#4R##Ė7GR##R3RS$Rs$R##R##R3R##cc�R##R#4R##R##R3R##�S#R##RsDR#4Rs$R##R##R3R##csR##R#4R##R##R3R##�ScR##RsDR#4Rs$R##R##R3R##csR##R#4R##R##R3R##�cR##RsDR#4Rs$R##R##R3R##cs#R##R#4R##R##R3R##863"},{"Q":"673","A":"1868"},{"Q":"674","A":"1874"},{"Q":"675","A":"1875"},{"Q":"676","A":"1877"},{"Q":"677","A":"1881"},{"Q":"678","A":"1884"},{"Q":"679","A":"1888"},{"Q":"680","A":"1892"},{"Q":"681","A":"1897"},{"Q":"682","A":"1901"},{"Q":"683","A":"1905"},{"Q":"684","A":"1908"},{"Q":"685","A":"1912"},{"Q":"686","A":"1915"},{"Q":"687","A":"1919"},{"Q":"688","A":"1925"},{"Q":"689","A":"1927"},{"Q":"690","A":"1932"},{"Q":"691","A":"1936"},{"Q":"692","A":"1939"},{"Q":"693","A":"1946"},{"Q":"694","A":"1947"},{"Q":"695","A":"1951"},{"Q":"696","A":"1955"},{"Q":"697","A":"1959"},{"Q":"698","A":"1965"}]}
值不能为 null
。
参数名: input
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。