开发者

How does server handle JSON in the body of a POST

开发者 https://www.devze.com 2023-01-24 06:51 出处:网络
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百科

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消