1、Post请求不同类型
///===========dynamic
$.ajax({
url: "api/Launch/Data",
type: "post",
data: JSON.stringify({ xml: xmlstr }),
contentType:"application/json",
dataType: "text",
async: false,
success: function (xml){}
});
public string Data(dynamic xml)
{
return "这是xml类型的参数";
}
///===========JObject
public string Data(JObject xml)
{
}
$.ajax({
url: "api/Launch/Data",
type: "post",
data: { xml: xmlstr },
dataType: "text",
async: false,
success: function (xml){}