4

我正在尝试使用 $.ajax 发布数据,但我收到失败消息 400 错误。以下是代码:

 $.ajax({

                url: "http://192.168.1.9:150/Service.svc/usrregistration",
                type: "POST",
                // data: '{"Firstname":' + Firstname + ',"LastName:"'+LastName+'}',
                data: '{"Firstname":"rose"}',

                contentType: "application/json; charset=utf-8",
                dataType: "json",
                processdata: true,
                success: function (msg) {
                    alert(msg);

                    alert('Registerd successfully');
                },
                error: function (msg) {

                    alert('Faild'+msg.status);
                }

            });
4

1 回答 1

3

这是我的博客文章:使用 WCF 创建 REST 服务并使用 jQuery 使用

带有 WCF 的 REST 服务和使用 jQuery 通过邮寄方式使用您可以轻松找出问题,但只需步行 2 或 3 分钟

其他

使用 jQuery 调用 WCF 服务的步骤

使用 Jquery/Javascript 调用跨域 WCF 服务

于 2011-03-18T04:38:01.267 回答