ASIHttpRequest send a weired status code of zero. Not reaching the server

故事扮演 提交于 2019-12-05 16:40:31

As well as what phooze suggested, there is logging in ASIHTTPRequestConfig.h that you can enable, that may provide a clue as to what is happening.

Are you looking at the status code of the ASIHTTPRequest object? That code is simply an HTTP response code - if you didn't get a response, then that should be zero.

Instead, you want to look at the NSError object that the delegate failure callback gives you.

I would use something like:

NSLog(@"%@",[error localizedErrorDescription]);

To print out to the log what the error is. Of course, "error" is the name of the variable in the method signature - you should double-check that, I think that's what the default is.

Feng Stone

In [ASHTTPRequest initialize], I changed

[sharedQueue setMaxConcurrentOperationCount:4]

to

[sharedQueue setMaxConcurrentOperationCount:10]

This work for me, but I don't know why.

MORE:

I found this.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!