因此,我升级了我的IDE和SDK,现在下面的代码不再起作用。我在此处添加一些文本,以尝试绕过该站点的法西斯验证,这是非常激进的。
String URL = "http://www.google.com";
Future future = client.getUrl(Uri.parse(URL))
.then((HttpClientRequest request) {
return request.close();
}).then((HttpClientResponse response) {
print('Status code: ${response.statusCode}');
print('Headers\n${response.headers}');
});
});
我现在收到以下异常。
Uncaught Error: Bad state: No elements
Stack Trace:
有任何想法吗?
最佳答案
在Windows上使用Dart 0.6.3.3_r24898
为我工作。
您确定这就是您拥有的所有代码吗?在堆栈跟踪中,我看到了WebSocketImpl
,您是否正在使用WebSockets?
关于httpclient - Google Dart HTTP客户端问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17768990/