1
私のアプリではASI HTTPの投稿リクエストを送信しているので、ユーザーは自分のWebサービスにレビューを投稿できますが、リクエストを送信する際に問題が発生しています。それは私が探しているが、その私を運転している単純なエラーを確認してください。ASI HTTPレビューを投稿するためのリクエスト
はレビュークラスの作成マイ次のとおりです。
-(void)Submit
{
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://furious-ice-356.heroku.com/places/%@/reviews.xml",self.identifier]];
//[NSURL URLWithString:[NSString stringWithFormat:@"https://furious-ice-356.heroku.com///places/%@/reviews.xml",self.identifier]];
self.bestnight.text = @"Monday";
ASIFormDataRequest *request1 = [ASIFormDataRequest requestWithURL:url];
[request1 setUsername:self.username];
[request1 setPassword:self.password];
[request1 setRequestMethod:@"POST"];
[request1 setPostValue:self.bestnight.text forKey:@"review[best-night]"];
[request1 setPostValue:self.comments.text forKey:@"review[comments]"];
[request1 setPostValue:self.rating.text forKey:@"review[rating]"];
[request1 setDelegate:self];
[request1 startAsynchronous];
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
}
- (void)requestFinished:(ASIHTTPRequest *)request
{
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
NSLog(@"FINISH Response received: %@", [request responseString]);
UIAlertView * av = [[[UIAlertView alloc] initWithTitle:@"Thank You" message:@"Your review was successfully posted. Thank You for making our App Better." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] autorelease];
[av show];
[self.navigationController popViewControllerAnimated:YES];
}
- (void)requestFailed:(ASIHTTPRequest *)request
{
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
NSLog(@"FAILED Response received: %@", [request responseString]);
}
ウェブサーバーから受け取ったエラーは何ですか? –
これは重複した質問です! :http://stackoverflow.com/questions/8114599/referencing-a-string-inside-an-nsurl – HyLian
2011-11-13 22:20:52.475 ClubsNi [14936:ec03] FAILEDレスポンス受信:HTTPダイジェスト:アクセスが拒否されました。 – Bradley