2つの配列と複数の値を送信するjsonを送信していますが、これを送信すると、成功コード200が返され、アクセスが拒否されたplsを示す応答が表示され、誰でもそれを解決する正しい方法が得られます**
-(void)SaveColumnConnection
{
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURLURLWithString:@"http://xxxyyyzzzz.php"]];
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:oneRowColumn,@"oneRowCols",memberTid,@"table_title_id",totalRowStr,@"totRow",rowandColumn,@"tempColName",tableOptIdArray ,@"tempOptid",companyId,@"companyid",@"savecolumniphone",@"tag",nil];
NSLog(@"dict %@",dict);
SBJSON *parser =[[SBJSON alloc] init];
NSString *jsonString = [parser stringWithObject:dict];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:[jsonString dataUsingEncoding:NSUTF8StringEncoding]];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
NSHTTPURLResponse *HTTPResponse = (NSHTTPURLResponse *)response;
NSInteger statusCode = [HTTPResponse statusCode];
if (statusCode==200) {
//Request goes in success
NSString *str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"Json for post array ----------%@",str);
}
else{
///request is get failed
NSLog(@"Error Description %@",[error localizedDescription]);
}
}];
[request release];
}