json事例

2023-11-13 20:18:26 浏览数 (2)

json请求事例:

代码语言:javascript复制
		post_data.entrance="1111";
        post_data.identity= "SZHT";
        post_data.member_id="40";
        post_data.message="测试111";
        post_data.skuItem="{"0":{"sku_id":"15942","cost_price":"183","sku_price":"232.00","sku_number":"3"}}"
        post_data.sku_source_type="0";
        post_data.post_data.member_id =40;
        $.ajax({
            url : "",
            type: "post",
            data:  JSON.stringify(post_data),
            /*data:{
                entrance_id:2,member_id:40,number:2,sku_id:15414
            },*/
            dataType: "json",
            cache: false,
            processData: false,
            contentType: "application/json; charset=utf-8",
            //contentType: 'application/x-www-form-urlencoded',
            success: function (rsp) {
                debugger;
                if (rsp.code != 200) {
                    console.log(rsp.msg);
                    //return;
                }

                console.log(rsp.data);
            }
        });

0 人点赞