我正在发送两个数组和多个值抛出 json 但是当我发送这个时我得到成功代码 200 并且它的响应显示访问被拒绝请任何人给我正确的方法来解决它**
-(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];
}