Q:

How to post json data to server

In my iPhone app I want to send my data in JSON format.I have stored all the data in an dictionary.How to change dictionary data in JSON format and then send it to the serve using post method (I need to send to server only).

A:

If your using SBJSON then using the code below you can create JSON string from NSDictionary.
 SBJsonWriter *jsonWriter = [SBJsonWriter new];
 NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjects:values forKeys:keys];
 NSString *jsonString = [jsonWriter stringWithObject:dict];

