メンバーのデータ型Dictionaryの1つを持つオブジェクトは、JSONを介して送信するときにnullとして取得されています
次のスキーマでDTOを作成しました
public class myclass
{
public string APIKey {get;set;}
public string APISecret {get;set;}
public string APIVersion {get;set;}
public Dictionary<string,string> Fields {get;set;}
}
以下のJSを使用してJSONをAPIに送信しようとしました
$.ajax({
type: "GET",
dataType: "jsonp",
url: $('#txtUrl').val(),
data: {APIKey:"test",APISecret:"test", APIVersion:"1.0",Fields:[{"Key":"JobID","Value":"2290277"},{"Key":"CountryID","Value":"1"}]},
success: function (data) {
// Now the two will work
$.each(data, function(key, value) {
if (key == 'Fields')
{
$.each(value, function(key2, value2) {
$('#result').append('<br />' + key2 + ' ' + value2);
});
}
else
$('#result').append('<br />' + key + ' ' + value);
});
}
});