0

guys! when i using asihttp in my app,i meant a post method with a nsmutabledata for body stream,but i can't get what should be,just couldn't callback the

- (void)requestFinished:(ASIHTTPRequest *)request;

or

- (void)request:(ASIHTTPRequest *)request didReceiveData:(NSData *)data

delegate method. ASIFormDataRequest can't either but Synchronous request is ok,just error for asynchronous.that's my request code below,how i can fit it for my app? thanks for any help!

ASIHTTPRequest* request=[ASIHTTPRequest requestWithURL:url];
    [request setDelegate:self];
    [request setPostBody:data];
    [request setTimeOutSeconds:30];
    [request setRequestMethod:@"POST"];
    [request startAsynchronous];
ben
  • 1,020
  • 1
  • 15
  • 27

1 Answers1

0

Try using the following:

[request setDidFinishSelector:@selector(requestDone:)];
[request setDidFailSelector:@selector(requestWentWrong:)];

That way you know for sure what methods the request should be calling when it's done.

joshholat
  • 3,371
  • 9
  • 39
  • 48