开发者

getting data from HTTP put

开发者 https://www.devze.com 2023-03-13 11:03 出处:网络
Note: This question is specific to Grails and jQuery I\'m making an ajax call to my server using PUT: $.ajax({

Note: This question is specific to Grails and jQuery

I'm making an ajax call to my server using PUT:

$.ajax({
    url: "admin/services/instance",
    type: "PUT",
    data: {instance: dataAsJSON},
    dataType: "json",
    async: false,
    success: function(){},
    error: function(){}
});

So this call works fine, it 开发者_如何学编程calls my controller, but when print params.instance, it's null.

But when i do this as a "POST" it works fine.

Does anyone have any thoughts?


According to the jQuery manual: "Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers."

Does your browser support PUT?

0

精彩评论

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