不使用contentType: “application/json”则data可以是对象

$.ajax({
                    url: 'http://localhost:24835/api/aaa',
                    type: 'post',
                    data: {
                        aaa: 111,
                        bbb: 222
                    },
                    contentType: 'application/json',
                    success: function(data) {
                        console.log(data);
                    }
                });

使用contentType: “application/json”则data只能是json字符串

$.ajax({
                    url: 'http://localhost:24835/api/aaa',
                    type: 'post',
                    data: '{aaa: 111,bbb: 222}',
                    contentType: 'application/json',
                    success: function(data) {
                        console.log(data);
                    }
                });