不允许用于访问路径“/主/ [对象的对象]”中的HTTP动词POST [英] The HTTP verb POST used to access path '/Main/[object Object]' is not allowed

查看:229
本文介绍了不允许用于访问路径“/主/ [对象的对象]”中的HTTP动词POST的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jQuery的电话:

Jquery call:

$.post({
        url: "http://localhost:60700/Main//Data/dataServices.aspx",
        data: { action: "savePhoneData", phoneID: PhoneID, values : JSON.stringify(allData) },
        success: phoneSaved,
        error: phoneSavedFailed
    });

我有一个在项目中使用类似的功能在 GET 方式和工作就好了。 在这种情况下,然而,发表必须使用由于数据量。

I have similar functions in the project that use the GET method and work just fine. In this case, however, POST must be used due to the amount of data.

我得到的错误是:用于访问路径/主/ [对象的对象]中的HTTP动词POST是不允许的。

The error I get is: The HTTP verb POST used to access path '/Main/[object Object]' is not allowed.

请帮忙!

推荐答案

我用了一个ASMX页面,而不是:

I used an ASMX page instead:

public class Handsets : System.Web.Services.WebService
    {

        [WebMethod]
        public string Test(object items)
        {
            List<object> lstItems = new JavaScriptSerializer().ConvertToType<List<object>>(items);
            return "wow";
        }
    }

这篇关于不允许用于访问路径“/主/ [对象的对象]”中的HTTP动词POST的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆