您好我有以下jQuery.post示例,需要知道如何使用Windows 7手机SDK发出相同的请求。
任何建议或指示都会受到影响。
jQuery.post('http://URL',{
'key':'4ec6975151b8ea0d768f8599541e2ee30fb20a93',
'function':'getGroupMembers',
'parameters':{
"group":{
'group_id':'44',
'user_id':'100003167624583'
}
}
},
function(res){
console.log(res);
},'json');
答案 0 :(得分:0)
WebClient.UploadStringAsync
将发布一个字符串并返回结果。您可以使用JSON.NET(通过NuGet或手动下载)来序列化/反序列化:
WebClient client = new WebClient();
client.UploadStringCompleted += (s,e) =>
{
var children = JToken.Parse(e.Result)["some_json_property"].Children();
// continue here (but remember this is all asynchronous)
};
client.UploadStringAsync(
new Uri("http://URI"),
"POST",
JsonConvert.SerializeObject(new
{
key = "4ec6975151b8ea0d768f8599541e2ee30fb20a93",
function = "getGroupMembers",
parameters = new {
group = {
group_id = "44",
user_id = "100003167624583"
}
}
}));