tags:

views:

772

answers:

2

I am using webservices.I am sending request from the iphone and fetch the data.I am using http request.But i want to use ASIhttprequest so how it possible?

+1  A: 

It's pretty clear. Just look here.

ennuikiller
+2  A: 

You should look at the ASIS3Request class for details on how to subclass ASIHTTPRequest and perform your own tasks before or after the request is complete. Your own subclass will look something like this:

@interface MyFancySubclass : ASIHTTPRequest {}
@end

@implementation MyFancySubclass

- (void) main {
  // Perform pre-request initialisation here
  [super main];
}

- (void) requestFinished {
  // Parse [self responseString] or [self responseData] here
  [super requestFinished];
}

- (void) failWithError:(NSError*)theError {
  // Handle errors here
  [super failWithError:theError];
}

@end

If you add your MyFancySubclass instances to an ASINetworkQueue, the parsing will be done off the main thread.

Nathan de Vries