I have a php website that returns YES or NO upon request. For example
www.test.com/test.php?variable=test1 will return me YES and www.test.com/test.php?variable=test2 will return me NO
I am trying to get this response into an Objective-C application I am creating but I have no luck up to now. Here is my code
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.test.com/test.php?variable=test1"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0];
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if (theConnection) {
NSMutableData *receivedData = [NSMutableData data];
NSString *strData = [[NSString alloc]initWithData:receivedData encoding:NSUTF8StringEncoding];
NSLog(@"This is the response: %@", strData);
}else {
}
Can anybody help me on that? is there any other way to do it? Am I doing something wrong?
Thanks a lot guys