I am using jQuery to post JSON data to a tomcat server and the server is handling the JSON array data perfectly! It is as though I passed key=value request parameters along with the URL. 开发者_C百科
So why am I posting this? I would like to know how the server treats JSON in the body of a request and how the data ends up being interpreted as request parameters. I have Googled my a** off and all I find is how the server sends JSON back to the client.
$.ajax() converts JSON data into key-value pairs (querystring style) by default. You need to set { processData : false }
in the AJAX request to keep it as raw JSON.
精彩评论