400将json数组发布到azure上的spring控制器时请求错误

400将json数组发布到azure上的spring控制器时请求错误,azure,spring-mvc,Azure,Spring Mvc,当我试图将json数组传递给azure应用程序服务上的spring控制器时,收到了400个错误请求。但是,当我尝试从本地环境运行服务时,没有收到任何错误。我的要求如下: $http.post(appPath + '/app/temp/saveTempData?tempData=' + JSON.stringify(row.data)).success(function(result) { if (result.result) { toa

当我试图将json数组传递给azure应用程序服务上的spring控制器时,收到了400个错误请求。但是,当我尝试从本地环境运行服务时,没有收到任何错误。我的要求如下:

$http.post(appPath + '/app/temp/saveTempData?tempData=' + JSON.stringify(row.data)).success(function(result) {

            if (result.result) {

                toaster.pop("successful", "Updated successfully");
            } else {
                toaster.pop("warning", "Something went wrong please try again later.");
            }
        })
其中row.data是一个json数组

@RequestMapping(value = "/saveTempData", method = RequestMethod.POST)
@ResponseBody
public String saveTempData(@RequestParam JSONArray tempData) {



}

此代码在我的本地计算机上运行,但在azure应用程序服务上,它给了我400个错误请求。谢谢。

在使用encodeURIComponent将json数组发送到应用程序服务控制器时,我们必须对请求参数进行编码,如下所示:

$http.post(appPath + '/app/temp/saveTempData?tempData=' + encodeURIComponent(JSON.stringify(row.data))).success(function(result) {

            if (result.result) {

                toaster.pop("successful", "Updated successfully");
            } else {
                toaster.pop("warning", "Something went wrong please try again later.");
            }
        })