Send a NSMutableArray to Json server in PHP
I have an NSmutableArray, and i want to send to the server in JSON format,the server will deserialize it and开发者_JAVA百科 uptade the mysql.
NSMutableArray * jsonObject = [[NSMutableArray alloc]initWithObjects:@"Some",nil];
NSString* jsonString = jsonObject.JSONRepresentation;
I think that´s the ideia its correct? And how to send to server?
Check out NSMutableURLRequest's setHTTPMethod: (@"POST") and setHTTPBody: methods. You can build request and send it by NSURLConnection.
NSMutableURLRequest class reference
NSURLConnection class reference
精彩评论