をGET WEBAPIにデータを送信します呼び出すよう: - メソッドは呼び出されますが、取得したSampleClassオブジェクトが 富栄nullである私はWEBAPIでモデルクラスの下に持って要求Ajax呼び出し
var source = {
'id': 0,
'Name': 'sagar'
}
$.ajax({
type: "GET",
dataType: "json",
url: "http://localhost:51366/api/Values",
data: source,
success: function (data) {
alert(data);
},
error: function (error) {
jsonValue = jQuery.parseJSON(error.responseText);
alert("error" + error.responseText);
}
});
t私はidを0、Nameをsagarとして送信しました。 nullの代わりにこれらの値を取得する必要があります。
[HttpGet]身体が含まれていないためアクセスできない場合は、[HttpPost] –