该
incident对象不是正确序列化的JSON字符串。您需要调用
JSON.stringify(this.incident)以获得等效的JSON字符串,并指定
application/jsonHTTP标头。
$.ajax({ url: 'http://example.com:9200/incidents/incidents', type: 'POST', data: JSON.stringify(this.incident), dataType: 'json' })
该
incident对象不是正确序列化的JSON字符串。您需要调用
JSON.stringify(this.incident)以获得等效的JSON字符串,并指定
application/jsonHTTP标头。
$.ajax({ url: 'http://example.com:9200/incidents/incidents', type: 'POST', data: JSON.stringify(this.incident), dataType: 'json' })