我想创建一个GET动作,除了现有的GET在不同的签名中我该怎么办? [英] I want to create a GET action addition the existing GET in different signature how could I do it?

查看:83
本文介绍了我想创建一个GET动作,除了现有的GET在不同的签名中我该怎么办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

//这是第一个非常好的GET动作!

public string Get(string carrier,int flightNum,DateTime date,string acNum)





//这是第二次GET行动

public void Get(string isaData)

{

}







//在JS中我用AJAX发送(用于第二次GET动作)它不起作用为什么???:



$(文件).on(点击,#save-button,功能( ){

$ .ajax({

url:WebApiUrl +'Isa',

data:localStorage.getItem(data),

类型:'GET',

contentType:'text / plain',



});

});

//This is the First GET action that works excellent!
public string Get(string carrier, int flightNum, DateTime date, string acNum)


//This is the second GET action
public void Get(string isaData)
{
}



//and in the JS I send in in AJAX(for the second GET action) it doesn't work WHY???:

$(document).on("click", "#save-button", function () {
$.ajax({
url: WebApiUrl + 'Isa',
data: localStorage.getItem("data"),
type: 'GET',
contentType: 'text/plain',

});
});

推荐答案

(文件).on(点击,#save-button,函数(){
(document).on("click", "#save-button", function () {


.ajax({

url:WebApiUrl +'Isa',

数据: localStorage.getItem(data),

类型:'GET',

contentType:'text / plain',



});

});
.ajax({
url: WebApiUrl + 'Isa',
data: localStorage.getItem("data"),
type: 'GET',
contentType: 'text/plain',

});
});


这篇关于我想创建一个GET动作,除了现有的GET在不同的签名中我该怎么办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆