Problem parsing AJAX response as valid JSON
I'm having a terrible problem try to track down the cause of/solution to this problem. I'm also unable to copy the data here as it's on a different network/system. Thus, any help would be much appreciated even though I understand it might be difficult.
Here's the issue: I have a simple sever set up to send me JSON data. Using firefox I can enter the url and get back the JSON result. I can copy/paste that result into Java and parse it into a JSON object no fuss/no muss. Thus I am confident the JSON I am getting from the server is correctly formatted. So far, so good.
Now I want to access that server with an ajax call. Same url, same parameters. I have verified this through the network request headers. In both cases (firefox/ajax) I get response headers that indicate 200 OK, and the correct length of the expected content results. Through firefox again I can see the results in the network response, Firefox also recognizes the response as JSON.
The problem: In the AJAX response, while the headers seem to.indicate the correct amount of data came back (along with the 200 OK response) the contents of the response body are empty and I am seeing a message that reads "
Syntaxerror JSON.parse: Unexpected end of data".
The data the server is sending back is valid JSON. I've verified that by parsing the data I get back when I call it from Firefox. The length of the data in the response is the same either way which I've verified by looking at the response headers. I assume the data in the ajax response is the same as that in the firefox response, but I can't verify that as some parser somewhere seems to be choking on the data and I don't know where that parser is nor how to find out where it's having problems.
Would appreciate any insights into this problem.