1、
$(function () { var dataJSON = {Id:1,Title:‘标题测试‘}; console.log(JSON.stringify(dataJSON)); $.ajax({ url: "http://localhost:53620/api/values", type: "Post", data: JSON.stringify(dataJSON), contentType: ‘application/json; charset=utf-8‘, dataType: ‘json‘, success: function () { } }) })
2、
$.ajax({ url: "http://localhost:53620/api/values", type: "Post", data: { Id: 1, Title: ‘标题测试‘ }, success: function () { } })
原文地址:https://www.cnblogs.com/superfeeling/p/12271593.html
时间: 2024-11-02 23:58:49