最近发生了一个神奇的故障。还没有定位到最终原因。暂时规避解决。记录如下.
客户端环境:MAC
服务器端环境:Apache Tomcat/7.0.59
客户端代码(python 2.7.8):
rv = requests.post(createConfigUrl, data=json.dumps(data), headers=header)
header = {
'Content-Type': 'application/json'
}
data = {
"a": a,
"b": b,
"c": c,
"param": json.dumps(param)
}
服务器返回HTTP 400:The request sent by the client was syntactically incorrect.
解决方案:
rv = requests.post(createConfigUrl, json=data, headers=header)
据资深工程师猜测:这个是JAVA服务器端和PYTHON服务器端的区别;根因尚未定位