I am trying to post a string to the server. I have these codes below that I know works but only after I added at least one EMPTY entry into the database (it will show up in the database still, as basically, like this: ""). I have no idea why the NSURLRequest has such strange behavior. Anyone can tell me why?
NSMutableString *postString = [NSMutableString stringWithString:@"http://website.com/post.php"];
[postString appendString:[NSString stringWithFormat:@"?loc=%@",locationBox.text]];
NSMutableURLRequest* request = [[NSMutableURLRequest alloc]initWithURL:[NSURL URLWithString:postString] cachePolicy:NSURLCacheStorageNotAllowed timeoutInterval:3];
[request setHTTPMethod:@"POST"];
postConnection = [[NSURLConnection alloc]initWithRequest:request delegate:self startImmediately:YES];