ios - Cancel Post request in Afnetworking 2.0 -


hi making post request using afnetworking 2.0. request looks this.

 afhttprequestoperationmanager *manager = [afhttprequestoperationmanager manager];             manager.responseserializer = [afxmlparserresponseserializer serializer];             [manager.requestserializer setvalue:@"some value" forhttpheaderfield:@"x"];              [manager post:url parameters:params success:^(afhttprequestoperation *operation, id responseobject) {                  //doing              } failure:^(afhttprequestoperation *operation, nserror *error) {                 // error handling.             }]; 

how can cancel request???

post method return afhttprequestoperation operation. can cancel calling cancel.

afhttprequestoperation *post =[manager post:nil parameters:nil success:^(afhttprequestoperation *operation, id responseobject) {   //doing } failure:^(afhttprequestoperation *operation, nserror *error) {    // error handling. }];  //cancel operation [post cancel]; 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -