NSDictionary *param = @{@"key1":@"value1",@"key2":@"value2"}; NSError *parseError = nil; NSData *jsonData = [NSJSONSerialization dataWithJSONObject:param options:NSJSONWritingPrettyPrinted error:&parseError]; NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];