URLは正しく書かれていますが、ブラウザでデータをテストして正しく送信しますが、要求を行うと成功したと返しますが、データを書き込みます。何か案が?NSURLConnectionはデータを送信しませんが接続します
- (void)writeAboutMe:(NSString *)about withIcebreaker:(NSString *)icebreaker
{
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
NSString *urlString = [NSString stringWithFormat:@"http://nailorbail.net63.net/submit_about_and_icebreaker.php?username=%@&about=%@&icebreaker=%@",[SignInViewController getUsernameString] ,about,icebreaker];
NSLog(@"%@",urlString);
[request setURL:[NSURL URLWithString:urlString]];
[request setHTTPMethod:@"GET"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Current-Type"];
NSURLConnection *conn = [[NSURLConnection alloc]initWithRequest:request delegate:self];
if(conn)
NSLog(@"Connection Successful");
else
NSLog(@"Connection could not be made");
[conn release];
}
ブラウザで同じURLの作品? URLにブラウザが正常に処理するスペースがあるかもしれませんが、NSURLを作成する前に自分で処理する必要があります。ユーザ名にスペースがない場合、コールはデータを送信しますか? –
NSCharacterSet whiteSpaceAndNewlineCharacterSetを使ってトリミングを試みましたが、それでもそれでも送信しません – Chris