How to print request string when ASIFormDataRequest failed?

440 views Asked by At

I am using ASIFormDataRequest asynchronously to get data from server. When request failed for any reason then I want to save URL and requested string in database for further reference.

I am getting the URL from [request url] but how to get requested string from request. Below code I am using.

 ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];

 [request setPostValue:requestString forKey:@"data"];

 [request setDelegate:self];

 [request startAsynchronous];

 //DELEGATE METHOD
 - (void)requestFailed:(ASIHTTPRequest *)request
 {
     //PRINT REQUEST STRING WHEN FAILED
 }

Thanks in advance.

1

There are 1 answers

0
Bobj-C On BEST ANSWER

Try to use [request setFailedBlock:^{...//print url...}];