ios - How to intercept the response of AFNetworking request in Objective-C? -
as titled, , how check http status of response?
for example, if server returns http status code 403, need send recall mail request again take new access token.
take @ below. in failure block, retry/resend query x number of times. sure add logic end retries @ point, don't end infinite loop.
afhttprequestoperationmanager *operationmanager = [afhttprequestoperationmanager manager]; [operationmanager post:url parameters:object success:^(afhttprequestoperation *operation, id responseobject) { } failure:^(afhttprequestoperation *operation, nserror *error) { if (operation.response.statuscode == 403) { // retry } } ];
this answer may helpful.
Comments
Post a Comment