使用POST方法的asihttp并将nsMutabledata发布到uri,为什么我无法获取asi委托回调?

问题描述

| 伙计们! 当我在我的应用程序中使用asihttp时,我的意思是一个带有nsmutabledata的post方法用于体流,但是我无法获取应有的内容,只是无法回调
- (void)requestFinished:(ASIHTTPRequest *)request;
要么
- (void)request:(ASIHTTPRequest *)request didReceiveData:(NSData *)data
委托方法。 ASIFormDataRequest不能 但是同步请求是可以的,对于异步来说只是错误。这是我下面的请求代码,我怎样才能适合我的应用程序?谢谢你的帮助!
ASIHTTPRequest* request=[ASIHTTPRequest requestWithURL:url];
    [request setDelegate:self];
    [request setPostBody:data];
    [request setTimeOutSeconds:30];
    [request setRequestMethod:@\"POST\"];
    [request startAsynchronous];
    

解决方法

尝试使用以下内容:
[request setDidFinishSelector:@selector(requestDone:)];
[request setDidFailSelector:@selector(requestWentWrong:)];
这样,您就可以确定请求完成后应调用哪种方法。     

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...