Hi,
I have PHP script link, which responds YES or NO when we set post userName and emailID. I have used ASI framework.
When I try to connect with the following code, I get a null return.
NSURL *url = [NSURL URLWithString:@"https://abc.com/abctest/registration.php"];
ASIFormDataRequest *request = [[ASIFormDataRequest alloc] initWithURL:url];
[request setPostValue:@"[email protected]" forKey:@"email"];
[request setPostValue:@"pqr" forKey:@"userName"];
[request start];
NSError *error = [request error];
if (!error) {
NSString *response = [request responseString];
printf("\n\n\n Responce %s",[response UTF8String]);
response = [response stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if ([response isEqualToString:@"YES"])
{
printf("\n\n YES");
}
}
I also tried delegates methods setDidFailSelector and setDidFinishSelector ...that time setDidFailSelector get called that means it fail to proceed request....where I am getting wrong????