I need to send the following JSON array via POST to our server:
task:{"id":"123","list":"456","done":1,"done_date":1305016383}
I tried using the JSON library , but it was kind of silly to use it. I even tried to create a POST-String myself, but also failed:
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]];
....
Could you help me? For me, a literal POST line would be enough :)
source
share