0
私はASIHTTPRequestを使用してサーバーURIに "POST"するとき、応答は "null"に戻ります。TomCatへのASIHTTPRequest POST
URI:「http://www.solok.com:8080/solok_interface/api/web/」 パラメータ:NSDictionary with key「content」。
ASIFormDataRequestの代わりにASIHTTPRequestを使用しようとしましたが、 "setPostValue"メソッドはありません。
助けてください、ありがとう!
NSURL * url = [NSURL URLWithString:@"http://localhost:8080/solok_interface/api/web/"];
ASIFormDataRequest *req = [ASIFormDataRequest requestWithURL:url];
[req setRequestMethod:@"POST"];
[req setPostValue:cipherString forKey:@"content"];
[req start];
NSError *error1 = [req error];
if (!error1) {
NSString *reponse = [req responseString];
NSLog(@"Response string is %@",reponse);
}
[req setDelegate:self];
[req setCompletionBlock:^{
NSLog(@"complete");
NSString *responseString = [req responseString];
NSLog(@"the string is %@",responseString);
NSLog(@"The data is %@ %d",[req responseStatusMessage],[req responseStatusCode]);
}];
[req setFailedBlock:^{
NSLog(@"@fail");
}];
実際にはcipherString内に値がありますか? – Luke
ところで、これを解決しても、ベン自身が推奨するように、ASIHTTPRequestからAFNetworkingに切り替えることをお勧めします。 ASIHTTPRequestはもはや積極的に開発されておらず、正式にはサポートされていません。 –
@ルークそれはちょうどNSString、感謝です。 –