I make a json string and then send it to server as data with ASIHTTPRequest, but my request arrives as empty array to server, could you please help me? how to send a valid data to server? Here is my code:
-(void)subimtSelection

int)selection
{
NSLog(@"Submiting selection");
NSString *choiceData=[NSString stringWithFormat:@"%d", selection];
NSError *theError=nil;
NSURL *myUrl=[NSURL URLWithString:@"http://q.crazyteabag.com/get_data.php"];
//[[CJSONSerializer serializer] serializeString:choiceData error:&theError];
NSMutableDictionary *requestDictionary=[[NSMutableDictionary alloc] init];
[requestDictionary setObject:choiceData forKey:@"data"];
//NSData *data=[[CJSONSerializer serializer] serializeArray:requestArray error:&theError];
//NSData *data=[[CJSONSerializer serializer] serializeDictionary:requestDictionary error:&theError];
NSString *jsonString=[requestDictionary JSONRepresentation];
//NSData *data=[[CJSONSerializer serializer] serializeString:choiceData error:&theError];
ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:myUrl];
[request addRequestHeader:@"Accept" value:@"application/json"];
[request addRequestHeader:@"Content-Type" value:@"application/json"];
[request setRequestMethod:@"POST"];
[request appendPostData:[jsonString dataUsingEncoding:NSUTF8StringEncoding]];
[request start];
//request.delegate=self;
NSLog(@"Data %@",jsonString);
NSLog(@"The Error: %@", theError);
}