开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜