如何使用jquery的POST
发送此字段"geo": {
"coordinates": [
56.3561,
25.3392
],
"type": "Point"
}
...
data: {geo:{"coordinates": [56.3561,25.3392],"type": "Point"}}
结果为String or unicode input unrecognized as WKT EWKT, and HEXEWKB
答案 0 :(得分:2)
您需要先将JSON对象转换为序列化字符串。
var jsonObject = {"geo": {
"coordinates": [
56.3561,
25.3392
],
"type": "Point"
}}
然后:
data: JSON.stringify(jsonObject)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify