I’m receiving fully formed JSON response from Postgres and attempting to pass it to a jQuery AJAX request. Cake wants to treat my DB data as raw data, though, and JSON encode it again, which is breaking things.
The data I get from the DB is pretty simple. It looks like this (two rows in this example).
{
"data":[
{"id":111870,"site_id":3076021583,"points":7,"area":37236.0725966764},
{"id":111802,"site_id":3076021583,"points":7,"area":37236.0725966764}
]
}
After Cake gets done with it, though, it looks like this.
{
"content": [
"{\u0022data\u0022:[{\u0022id\u0022:111870,\u0022site_id\u0022:3076021583,\u0022points\u0022:7,\u0022area\u0022:37236.0725966764},{\u0022id\u0022:111802,\u0022site_id\u0022:3076021583,\u0022points\u0022:7,\u0022area\u0022:37236.0725966764}]}"
]
}
I need to turn that off, and just allow the response to go through normally, with the correct Accept and Content-Type headers in place.
Any help or clues for the clueless?