How to cancel a ASIFormDataRequest using blocks?.
__block ASIFormDataRequest *req = [ASIFormDataRequest requestWithURL:url];
[req appendPostData:[str dataUsingEncoding:NSUTF8StringEncoding]];
[req setDelegate:self];
[req setCompletionBlock:^{
[self parseResult:req];
}];
[req setFailedBlock:^{
[self requestWentWrong:req];
}];
[req setTag:tag];
[req startAsynchronous];
Is there any way to cancel this request in a button action?
Add this code in Your button action Event as req is class memeber variable: