开发者

Send a NSMutableArray to Json server in PHP

开发者 https://www.devze.com 2023-04-04 18:47 出处:网络
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.

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

精彩评论

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

关注公众号