发送JSON数组我需要通过POST发送以下JSON阵列到我们的服务器:iPhone通过POST
task:{"id":"123","list":"456","done":1,"done_date":1305016383}
我与JSON库试过,但我莫名其妙地愚蠢的用它。我甚至试图自己建立POST-String,但也失败了:
NSString *post = @"task='{id:123,list:456,done:1,done_date:1305016383}'";
NSMutableURLRequest *request=[NSMutableURLRequest requestWithURL:url
cachePolicy:NSURLRequestReloadIgnoringCacheData
timeoutInterval:30];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:[post dataUsingEncoding:NSUTF8StringEncoding]];
....
你能帮我吗? json'ed POST字符串对我来说已经足够了:)
[JSON数组格式]可能的重复(http://stackoverflow.com/questions/7055475/json-array-format) – 2012-01-16 20:20:52