HttpClient错误获取响应流(ReadDone1):ReceiveFailure [英] HttpClient Error getting response stream (ReadDone1): ReceiveFailure

查看:324
本文介绍了HttpClient错误获取响应流(ReadDone1):ReceiveFailure的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用HttpClient类发出Web请求以从服务器获取数据(httpClient.GetAsync(url,HttpCompletionOption.ResponseContentRead).但是随机出现此错误,提示获取响应流(ReadDone1)时出错:ReceiveFailure 我在该调用周围有一个try catch块,但没有被捕获,而是在IOS App的 UIApplication.Main(args,null,"AppDelegate"); 中收到错误.有什么办法可以捕获此错误或修复此错误?

I am using HttpClient class to make a web request to get data from server( httpClient.GetAsync(url, HttpCompletionOption.ResponseContentRead). But randomly i get this error saying Error getting response stream (ReadDone1): ReceiveFailure I have a try catch block around this call but it does not get caught. Instead I get the error in UIApplication.Main(args, null, "AppDelegate"); in the IOS App. Is there any way to catch this error or to fix this error?

推荐答案

您是否正在使用ModernHttpClient?如果没有,试一试.它可以作为组件使用,也可以在github上使用.这是对HttpClient的替代,性能更好.

Are you using ModernHttpClient? If not, give it a shot. It's available as a component and on github. It's a drop in replacement for HttpClient that performs a lot better.

这篇关于HttpClient错误获取响应流(ReadDone1):ReceiveFailure的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆