私のアプリからWebサーバー上のPHPファイルに提案を送信しようとしていますが、ブラウザにPHPスクリプトをテストしました。このスクリプトはユーザーに電子メールを送信し、データベースに提案を保存します。 。そして、次のスクリプトを実行しているとき、私は、しかし、私は私のデータベースに結果を受信しませんIOSを介した接続に成功を得る。..IOS 5でHTTP GET要求を行う最も簡単な方法は何ですか?
NSString *post = [NSString stringWithFormat:@"http://blahblah.com/suggest.php?s=%@&n=%@&e=%@", suggestion, name, email];
// Create the request.
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:post]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0];
// create the connection with the request
// and start loading the data
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if (theConnection) {
NSLog(@"Connection establisted successfully");
} else {
NSLog(@"Connection failed.");
}
私はすべての文字列をチェックし、など20%で、すべてのスペースをエンコードしている..ことができます誰でも私のスクリプトがうまくいかないという明白な明白な理由が見えますか?
サファリを開かずにアプリケーションからHTTPリクエストを送信する最も簡単な方法は何ですか?