I have tried many methods of posting data to server but none of them worked and only response am getting is:
{\"Message\":\"An error has occurred.\"}
Thank You @Tj3N, your answer was helpful.
Just needed to change encoding type. From NSASCIIStringEncoding to NSUTF8StringEncoding. Below is the Updated code.
NSString *post =[NSString stringWithFormat:@"customerid=%@&productid=%@&vendorid=%@&quantity=%@",cid,PID,VID,QQ];
NSData *postData = [post dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
NSURL *url = [NSURL URLWithString:@"URL"];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
[theRequest setHTTPMethod:@"POST"];
[theRequest setHTTPBody:postData];
NSURLResponse *response;
NSError *error;
NSData *urlData=[NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];
NSString *str=[[NSString alloc]initWithData:urlData encoding:NSUTF8StringEncoding];
NSLog(@"str:%@",str);