When i use ASIHTTPRequest to “POST” to server URI, just response back “null”.
URI: “http://www.solok.com:8080/solok_interface/api/web/“
parameter: NSDictionary with key “content”.
I try to use ASIHTTPRequest instead of ASIFormDataRequest, but there’s no “setPostValue” method.
Any help, thanks!
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");
}];
I didn’t use ASIHTTPRequest anymore, the ASI team has stopped to support it. AFNetworking is the right choice for IOS developer.