阅读背景:

使用Web API控制器解析传入的JSON(来自javascript Ajax帖子)

来源:互联网 

I have the following script

我有以下脚本

<script>
    $(window).load(function () {
        var model = [
            {
                "reservation":
                {
                    "ticketId": "782274b8-10d9-444c-8f05-3117853e3ee0",
                    "clubId": 70656,
                    "courtNumber": 1,
                    "crud_name": "add",
                    "reservationtype_name": "toernooi"
                }
            }, 
            {
                "reservation":
                {
                    "ticketId": "782274b8-10d9-444c-8f05-3117853e3ee0",
                    "clubId": 70656,
                    "courtNumber": 1,
                    "crud_name": "update",
                    "reservationtype_name": "toernooi"
                }
            }
        ];
        alert(JSON.stringify(model));
        $.ajax({
            type: "POST",
            data: JSON.stringify(model),
            url: "https://localhost:59854/api/incomingapi",
            contentType: "application/json",
            dataType: 'json',
            success: function (result) { },
            error: function (errResult) { }
        });
    });
</script>
<script>



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: